{"id":14990329,"url":"https://github.com/vardius/web-component","last_synced_at":"2025-06-23T05:07:23.039Z","repository":{"id":20646502,"uuid":"90512350","full_name":"vardius/web-component","owner":"vardius","description":"Lightweight library providing interface for building web components","archived":false,"fork":false,"pushed_at":"2022-12-06T19:50:17.000Z","size":772,"stargazers_count":37,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-14T06:54:17.124Z","etag":null,"topics":["shadowroot","web-component","web-components","webcomponents"],"latest_commit_sha":null,"homepage":"","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/vardius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["vardius"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-05-07T06:02:53.000Z","updated_at":"2025-02-17T17:18:39.000Z","dependencies_parsed_at":"2023-01-12T03:30:50.034Z","dependency_job_id":null,"html_url":"https://github.com/vardius/web-component","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/vardius/web-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fweb-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fweb-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fweb-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fweb-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vardius","download_url":"https://codeload.github.com/vardius/web-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardius%2Fweb-component/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259890555,"owners_count":22927385,"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":["shadowroot","web-component","web-components","webcomponents"],"created_at":"2024-09-24T14:19:54.124Z","updated_at":"2025-06-23T05:07:18.028Z","avatar_url":"https://github.com/vardius.png","language":"JavaScript","readme":"# web-component\n\n[![Build Status](https://travis-ci.org/vardius/web-component.svg?branch=master)](https://travis-ci.org/vardius/web-component)\n[![codecov](https://codecov.io/gh/vardius/web-component/branch/master/graph/badge.svg)](https://codecov.io/gh/vardius/web-component)\n[![npm version](https://img.shields.io/npm/v/web-component.svg)](https://www.npmjs.com/package/web-component)\n[![npm downloads](https://img.shields.io/npm/dm/web-component.svg)](https://www.npmjs.com/package/web-component)\n[![license](https://img.shields.io/github/license/vardius/web-component.svg)](LICENSE.md)\n\nLightweight library providing interface for building [web components](https://www.webcomponents.org/).\n\n## Contribution\n\nIs *web-component* library missing something ?\n\nNo problem! Simply [fork](https://github.com/vardius/web-component/network#fork-destination-box) this repository, [add middleware](https://github.com/vardius/web-component/wiki/Middleware) and create pull request.\n\n## Installation\n\n```bash\nnpm install --save web-component\n```\n\n## [Documentation](https://github.com/vardius/web-component/wiki)\n\nPackage provides a `decorator` function that allows you to:\n\n- easy define [Custom Elements](https://www.webcomponents.org/introduction#custom-elements)\n- styling a custom element\n- creating elements from a template\n- encapsulate style and markup using [Shadow DOM](https://www.webcomponents.org/introduction#shadow-dom)\n- extending other custom elements or even the browser's built-in HTML\n\n```javascript\nimport { WebComponent } from 'web-component'\n\n@WebComponent('hello-world', {\n  template: require('./hello-world.html'),// provide template\n  styles: require('./hello-world.css'), //provide styles\n  extends: 'button', //default does not extends any\n  shadowDOM: true, //default false\n  mode: \"open\" // default open, set to closed to block access to shadowDOM\n})\nexport class HelloWorld extends HTMLElement {}\n```\n\nIf *_shadowDOM_* option is set to `true` then *_template_* and *_styles_* will be attached to [shadowRoot](https://w3c.github.io/webcomponents/spec/shadow/#concept-shadow-root). If there is no *_shadowRoot_*, it will be created with [mode](https://w3c.github.io/webcomponents/spec/shadow/#dom-shadowroot-mode) `open`.\n\n1. [Hello World Example](https://github.com/vardius/web-component/wiki/Hello-World-Example)\n2. [web-components-webpack-es6-boilerplate](https://github.com/vardius/web-components-webpack-es6-boilerplate)\n\n## License\n\nThe code is available under the [MIT license](LICENSE.md).\n","funding_links":["https://github.com/sponsors/vardius"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardius%2Fweb-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvardius%2Fweb-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardius%2Fweb-component/lists"}