{"id":13806668,"url":"https://github.com/riot/custom-elements","last_synced_at":"2025-04-25T10:30:55.188Z","repository":{"id":33861811,"uuid":"162338716","full_name":"riot/custom-elements","owner":"riot","description":"Simple API to create vanilla custom elements with riot","archived":false,"fork":false,"pushed_at":"2023-12-01T23:17:58.000Z","size":831,"stargazers_count":34,"open_issues_count":5,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-03T13:54:04.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/riot.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-12-18T19:55:26.000Z","updated_at":"2023-03-07T01:34:53.000Z","dependencies_parsed_at":"2024-01-23T21:43:35.414Z","dependency_job_id":null,"html_url":"https://github.com/riot/custom-elements","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":"0.11904761904761907","last_synced_commit":"03ab98609b6a8393cf53a4378c99ef85a24645bc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riot%2Fcustom-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riot%2Fcustom-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riot%2Fcustom-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riot%2Fcustom-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riot","download_url":"https://codeload.github.com/riot/custom-elements/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223996429,"owners_count":17238292,"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":[],"created_at":"2024-08-04T01:01:14.526Z","updated_at":"2024-11-10T18:29:45.714Z","avatar_url":"https://github.com/riot.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":["Integrations"],"readme":"# @riotjs/custom-elements\n\n[![Riot.js custom elements logo](https://raw.githubusercontent.com/riot/branding/main/custom-elements/custom-elements-horizontal.svg)](https://github.com/riot/custom-elements/)\n\nSimple API to create vanilla custom elements with riot\n\n[![Build Status][ci-image]][ci-url]\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads][npm-downloads-image]][npm-url]\n[![MIT License][license-image]][license-url]\n\n## Demos\n\n- [Simple Demo](https://codesandbox.io/p/sandbox/riot-custom-elements-demo-forked-xqw2sq)\n\n\n## Usage\n\n```js\nimport MyComponent from './my-component.riot'\nimport define from '@riotjs/custom-elements'\n\ndefine('x-tag', MyComponent)\n```\n\nNotice that in order to update the component properties via attribute you will need to rely on the [`observedAttributes`](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) array\n\n```html\n\n\u003cmy-component\u003e\n  \u003cp\u003e{props.message}\u003c/p\u003e\n  \u003cscript\u003e\n    export default {\n      // the message property will be automatically updated anytime the DOM `message` attribute will change\n      observedAttributes: ['message']\n    }\n  \u003c/script\u003e\n\u003c/my-component\u003e\n```\n\n\n[ci-image]:https://img.shields.io/github/actions/workflow/status/riot/custom-elements/test.yml?style=flat-square\n[ci-url]:https://github.com/riot/custom-elements/actions\n\n[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square\n[license-url]:LICENSE\n\n[npm-version-image]:http://img.shields.io/npm/v/@riotjs/custom-elements.svg?style=flat-square\n[npm-downloads-image]:http://img.shields.io/npm/dm/@riotjs/custom-elements.svg?style=flat-square\n[npm-url]:https://npmjs.org/package/@riotjs/custom-elements\n\n## API\n\nThis module exports only a single factory function that is a wrapper around the native `customElements.define`. The `define` function accepts only 3 parameters:\n\n- tag name\n- tag api normally generated via riot compiler\n- custom options to pass to `customElements.define` like `{extends: 'button'}` for example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friot%2Fcustom-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friot%2Fcustom-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friot%2Fcustom-elements/lists"}