{"id":13837706,"url":"https://github.com/nativew/nativeweb","last_synced_at":"2026-06-12T00:04:07.058Z","repository":{"id":57308867,"uuid":"230481605","full_name":"nativew/nativeweb","owner":"nativew","description":"🤳 Tiny library for simple web components. [1kB]","archived":false,"fork":false,"pushed_at":"2021-06-05T02:20:00.000Z","size":151,"stargazers_count":103,"open_issues_count":0,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-10-28T10:34:41.197Z","etag":null,"topics":["components","framework","javascript","js","native-web","web-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nativew.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}},"created_at":"2019-12-27T17:02:20.000Z","updated_at":"2025-10-08T03:33:30.000Z","dependencies_parsed_at":"2022-09-01T06:31:50.902Z","dependency_job_id":null,"html_url":"https://github.com/nativew/nativeweb","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nativew/nativeweb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativew%2Fnativeweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativew%2Fnativeweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativew%2Fnativeweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativew%2Fnativeweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativew","download_url":"https://codeload.github.com/nativew/nativeweb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativew%2Fnativeweb/sbom","scorecard":{"id":676035,"data":{"date":"2025-08-11","repo":{"name":"github.com/nativew/nativeweb","commit":"baaf560715b1f5f30eb415a259432f7e6a18b448"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: ISC License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}}]},"last_synced_at":"2025-08-21T21:29:07.043Z","repository_id":57308867,"created_at":"2025-08-21T21:29:07.043Z","updated_at":"2025-08-21T21:29:07.043Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34222743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["components","framework","javascript","js","native-web","web-components"],"created_at":"2024-08-04T15:01:21.366Z","updated_at":"2026-06-12T00:04:07.037Z","avatar_url":"https://github.com/nativew.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://github.com/nativew/nativeweb\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/nativew/nativeweb/1e9405c629e3a6491bb59df726044eb3823967bb/logo-rectangle_nativeweb.svg\" alt=\"Native Web\"\u003e\n        \u003c/a\u003e\n    \u003c/p\u003e\n    \u003cp\u003e\n        Tiny library for simple web components. \u003cbr\u003e\n        \u003csub\u003e\u003ccode\u003e1kB\u003c/code\u003e\u003c/sub\u003e\n    \u003c/p\u003e\n    \u003cbr\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n```js\nimport { component, property, Element } from 'nativeweb';\n\n@component('hey-internet')\nclass Component extends Element {\n    @property() emoji;\n\n    render() {\n        return `\n            \u003ch1\u003eHey Internet ${this.emoji}\u003c/h1\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003chey-internet emoji=\"👋\"\u003e\u003c/hey-internet\u003e\n```\n\n\u003cbr\u003e\n\n### Native web components\n\n### Encapsulated styles and scripts\n\n### Simplified with decorators\n\n### Tiny footprint\n\n\u003cbr\u003e\n\n### One command to [start](https://github.com/nativew/start)\n\n```zsh\nnpm init nativeweb\n```\n\n\u003cbr\u003e\n\n### Or add to your existing project\n\n```zsh\nnpm install nativeweb\n```\n\n\u003cbr\u003e\n\n### Decorators\n\n[`@component`](#component)\n\n[`@property`](#property)\n\n[`@event`](#event)\n\n[`@customEvent`](#customevent)\n\n[`@query`](#query)\n\n[`@queryAll`](#queryall)\n\n\u003cbr\u003e\n\n### `@component`\n\nDefine a custom element and add styles. From an external file or the same file. `styles` can be an `array` of styles.\n\n```js\nimport { component, Element } from 'nativeweb';\nimport styles from './hey-styles.css.js';\n\n@component('some-styles', styles)\nclass Component extends Element {\n    render() {\n        return `\n            \u003ch1\u003eSome Styles\u003c/h1\u003e\n        `;\n    }\n}\n```\n\n```js\nimport { css } from 'nativeweb';\n\nexport default css`\n    h1 {\n        color: orange;\n    }\n`;\n```\n\n```html\n\u003chey-styles\u003e\u003c/hey-styles\u003e\n```\n\n\u003cbr\u003e\n\n### `@property`\n\nGet an attribute converted to the specified type or define a property with an optional default value.  \n`String`, `Boolean`, `Number`, `Array` or `Object`.\n\n```js\nimport { component, property, Element } from 'nativeweb';\n\n@component('cool-property')\nclass Component extends Element {\n    @property() cool = 'Cool Prop';\n    @property(String) title = 'Default Title';\n    @property(Number) multiplier;\n\n    render() {\n        return `\n            \u003ch1\u003e${this.title}\u003c/h1\u003e\n            \u003ch2\u003e${this.cool} ➡️ ${2 * this.multiplier}\u003c/h2\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003ccool-property title=\"Cool Title 🤙\" multiplier=\"3\"\u003e\u003c/cool-property\u003e\n```\n\n\u003cbr\u003e\n\n### `@event`\n\nAdd an event listener to a component, a child element named `@name` or an external component event.\n\n```js\nimport { component, event, Element } from 'nativeweb';\n\n@component('easy-event')\nclass Component extends Element {\n    @event() mouseenter = this.onHover();\n    @event() click = {\n        '@title': this.onClick(),\n        '@button': this.onClick()\n    };\n    @event() ready = {\n        'other-component': this.onReady()\n    };\n\n    onHover() {\n        console.log('Hover Component');\n    }\n    onClick(e) {\n        console.log(e.currentTarget);\n    }\n    onReady({ detail }) {\n        console.log(detail);\n    }\n\n    render() {\n        return `\n            \u003ch1 @title\u003eEasy Event\u003c/h1\u003e\n            \u003cbutton @button\u003eClick Me\u003c/button\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003ceasy-event\u003e\u003c/easy-event\u003e\n```\n\n\u003cbr\u003e\n\n### `@customEvent`\n\nCreate a custom global event, namespaced with the component name. Ready to be dispatched. The listener is in the [component above](#event).\n\n```js\nimport { component, customEvent, Element } from 'nativeweb';\n\n@component('other-component')\nclass Component extends Element {\n    @customEvent() ready = 'Ready 🚀';\n\n    connected() {\n        dispatchEvent(this.ready);\n    }\n\n    render() {\n        return `\n            \u003ch1\u003eOther Component\u003c/h1\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003cother-component\u003e\u003c/other-component\u003e\n```\n\n\u003cbr\u003e\n\n### `@query`\n\nQuery selector an `@name` child element.\n\n```js\nimport { component, query, Element } from 'nativeweb';\n\n@component('simple-query')\nclass Component extends Element {\n    @query() title;\n\n    connected() {\n        this.title.innerText = 'Better Title 💯';\n    }\n\n    render() {\n        return `\n            \u003ch1 @title\u003eGood Title\u003c/h1\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003csimple-query\u003e\u003c/simple-query\u003e\n```\n\n\u003cbr\u003e\n\n### `@queryAll`\n\nQuery selector all `@name` child elements.\n\n```js\nimport { component, queryAll, Element } from 'nativeweb';\n\n@component('all-query')\nclass Component extends Element {\n    @queryAll() title;\n\n    connected() {\n        this.title.forEach(el =\u003e (el.style.color = 'lightgreen'));\n    }\n\n    render() {\n        return `\n            \u003ch1 @title\u003eOne Title\u003c/h1\u003e\n            \u003ch2 @title\u003eOther Title\u003c/h2\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003call-query\u003e\u003c/all-query\u003e\n```\n\n\u003cbr\u003e\n\n### Lifecycle\n\n`render()` \u0026nbsp; → \u0026nbsp; Renders the component.\n\n`connected()` \u0026nbsp; → \u0026nbsp; Called when the component is inserted in the DOM.\n\n`disconnected()` \u0026nbsp; → \u0026nbsp; Called when the component is removed from the DOM.\n\n`adopted()` \u0026nbsp; → \u0026nbsp; Called when the component is moved to a new document.\n\n`attributeChanged()` \u0026nbsp; → \u0026nbsp; Called when an observed attribute changes.\n\n\u003cbr\u003e\n\n### Methods\n\n`this.update()` \u0026nbsp; → \u0026nbsp; Rerenders the component.\n\n\u003cbr\u003e\n\n### Properties\n\n`this.properties` \u0026nbsp; → \u0026nbsp; Get all attributes.\n\n\u003cbr\u003e\n\n### Tips\n\n[Shared style](#shared-style)\n\n[Composition](#composition)\n\n[Conditional](#conditional)\n\n[Loop](#loop)\n\n[Variable element](#variable-element)\n\n\u003cbr\u003e\n\n### Shared style\n\nInclude global styles in a component.\n\n```js\nimport { css } from 'nativeweb';\nimport global from '../global-style.css.js';\n\nexport default [\n    global,\n    css`\n        h1 {\n            color: orange;\n        }\n    `\n];\n```\n\n\u003cbr\u003e\n\n### Composition\n\nComponent composition with default slot and named slot.\n\n```js\nimport { component, Element } from 'nativeweb';\n\n@component('slot-example')\nclass Component extends Element {\n    render() {\n        return `\n            \u003cheader\u003e\n                \u003ch1\u003e\u003cslot name=\"title\"\u003e\u003c/slot\u003e\u003c/h1\u003e\n                \u003cslot\u003e\u003c/slot\u003e\n            \u003c/header\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003cslot-example\u003e\n    \u003cspan slot=\"title\"\u003eNamed slot\u003c/span\u003e\n    \u003cp\u003eDefault slot\u003c/p\u003e\n\u003c/slot-example\u003e\n```\n\n\u003cbr\u003e\n\n### Conditional\n\nConditional rendering in vanilla JS.\n\n```js\nimport { component, property, Element } from 'nativeweb';\n\n@component('condition-example')\nclass Component extends Element {\n    @property() isGood = false;\n\n    render() {\n        return `\n            ${this.isGood ? `\u003ch1\u003eGood\u003c/h1\u003e` : ``}\n        `;\n    }\n}\n```\n\n\u003cbr\u003e\n\n### Loop\n\nRender loop in vanilla JS.\n\n```js\nimport { component, property, Element } from 'nativeweb';\n\n@component('loop-example')\nclass Component extends Element {\n    @property() emojis = ['🤳', '🧨', '🧱'];\n\n    render() {\n        return `\n            ${this.emojis.map(item =\u003e `\u003cspan\u003e${item}\u003c/span\u003e`).join('')}\n        `;\n    }\n}\n```\n\n\u003cbr\u003e\n\n### Variable element\n\nRender an element from a property.\n\n```js\nimport { component, property, Element } from 'nativeweb';\n\n@component('element-example')\nclass Component extends Element {\n    @property() as = 'p';\n\n    render() {\n        return `\n            \u003c${this.as}\u003eHeading 1\u003c/${this.as}\u003e\n        `;\n    }\n}\n```\n\n```html\n\u003celement-example as=\"h1\"\u003e\u003c/element-example\u003e\n```\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://github.com/nativew/nativeweb\"\u003e\n            \u003cimg src=\"https://raw.githubusercontent.com/nativew/nativeweb/1e9405c629e3a6491bb59df726044eb3823967bb/logo-square_nativeweb.svg\" alt=\"Native Web\"\u003e\n        \u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativew%2Fnativeweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativew%2Fnativeweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativew%2Fnativeweb/lists"}