{"id":15388233,"url":"https://github.com/georapbox/resize-observer-element","last_synced_at":"2025-10-19T06:01:39.746Z","repository":{"id":57682331,"uuid":"485856159","full_name":"georapbox/resize-observer-element","owner":"georapbox","description":"A custom element that offers a declarative interface to the ResizeObserver API.","archived":false,"fork":false,"pushed_at":"2024-11-25T07:22:31.000Z","size":367,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T00:51:15.119Z","etag":null,"topics":["custom-elements","web-components"],"latest_commit_sha":null,"homepage":"https://georapbox.github.io/resize-observer-element/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georapbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-26T16:01:43.000Z","updated_at":"2024-11-25T07:22:35.000Z","dependencies_parsed_at":"2024-08-26T17:37:09.514Z","dependency_job_id":null,"html_url":"https://github.com/georapbox/resize-observer-element","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"d752fa52a76a57993f29a0961dac0128363a0d6b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georapbox%2Fresize-observer-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georapbox%2Fresize-observer-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georapbox%2Fresize-observer-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georapbox%2Fresize-observer-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georapbox","download_url":"https://codeload.github.com/georapbox/resize-observer-element/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565084,"owners_count":21125418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-elements","web-components"],"created_at":"2024-10-01T14:56:04.265Z","updated_at":"2025-10-19T06:01:34.678Z","avatar_url":"https://github.com/georapbox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/@georapbox/resize-observer-element.svg)](https://www.npmjs.com/package/@georapbox/resize-observer-element)\n[![npm license](https://img.shields.io/npm/l/@georapbox/resize-observer-element.svg)](https://www.npmjs.com/package/@georapbox/resize-observer-element)\n\n[demo]: https://georapbox.github.io/resize-observer-element/\n[license]: https://github.com/georapbox/resize-observer-element/blob/main/LICENSE\n[changelog]: https://github.com/georapbox/resize-observer-element/blob/main/CHANGELOG.md\n\n# \u0026lt;resize-observer\u0026gt;\n\nA custom element that offers a declarative interface to the [ResizeObserver API](https://developer.mozilla.org/docs/Web/API/ResizeObserver).\n\n[API documentation](#api) \u0026bull; [Demo][demo]\n\n## Install\n\n```sh\n$ npm install --save @georapbox/resize-observer-element\n```\n\n## Usage\n\n### Script\n\n```js\nimport { ResizeObserverElement } from './node_modules/@georapbox/resize-observer-element/dist/resize-observer.js';\n\n// Manually define the element.\nResizeObserverElement.defineCustomElement();\n```\n\nAlternatively, you can import the automatically defined custom element.\n\n```js\nimport './node_modules/@georapbox/resize-observer-element/dist/resize-observer-defined.js';\n```\n\n### Markup\n\n```html\n\u003cresize-observer\u003e\n  \u003cp\u003eLorem, ipsum dolor sit amet consectetur adipisicing elit.\u003c/p\u003e\n  \u003cp\u003eQuas quo aliquam iure ipsa laborum! Deleniti doloremque quaerat sunt, esse fugit.\u003c/p\u003e\n  \u003cp\u003eMolestias, libero laborum minus facere ullam iusto eius in adipisci quaerat autem placeat quisquam.\u003c/p\u003e\n\u003c/resize-observer\u003e\n```\n\n## API\n\n### Properties\n| Name | Reflects | Type | Default | Description |\n| ---- | -------- | ---- | ------- | ----------- |\n| `disabled` | ✓ | Boolean | `false` | Defines if the resize observer is disabled or not. |\n\n### Slots\n\n| Name | Description |\n| ---- | ----------- |\n| (default) | The default slot where the elements to observe are placed. |\n\n### Methods\n\n| Name | Type | Description | Arguments |\n| ---- | ---- | ----------- | --------- |\n| `defineCustomElement` | Static | Defines/registers the custom element with the name provided. If no name is provided, the default name is used. The method checks if the element is already defined, hence will skip trying to redefine it. | `elementName='resize-observer'` |\n\n### Events\n\n| Name | Description | Event Detail |\n| ---- | ----------- | ------------ |\n| `resize-observer:resize` | Emitted when the element is resized. | `{ entries: ResizeObserverEntry[]` |\n\n## Changelog\n\nFor API updates and breaking changes, check the [CHANGELOG][changelog].\n\n## Development setup\n\n### Prerequisites\n\nThe project requires `Node.js` and `npm` to be installed on your environment. Preferrably, use [nvm](https://github.com/nvm-sh/nvm) Node Version Manager and use the version of Node.js specified in the `.nvmrc` file by running `nvm use`.\n\n### Install dependencies\n\nInstall the project dependencies by running the following command.\n\n```sh\nnpm install\n```\n\n### Build for development\n\nWatch for changes and start a development server by running the following command.\n\n```sh\nnpm start\n```\n\n### Linting\n\nLint the code by running the following command.\n\n```sh\nnpm run lint\n```\n\n### Testing\n\nRun the tests by running any of the following commands.\n\n```sh\nnpm test\nnpm run test:watch # watch mode\n```\n\n### Build for production\n\nCreate a production build by running the following command.\n\n```sh\nnpm run build\n```\n\n## License\n\n[The MIT License (MIT)][license]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorapbox%2Fresize-observer-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorapbox%2Fresize-observer-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorapbox%2Fresize-observer-element/lists"}