{"id":19553724,"url":"https://github.com/michaljach/htm0","last_synced_at":"2026-05-07T19:01:51.996Z","repository":{"id":205137896,"uuid":"712894376","full_name":"michaljach/htm0","owner":"michaljach","description":"Fast and elegant Web Components framework.","archived":false,"fork":false,"pushed_at":"2023-11-16T16:26:00.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-08T20:44:26.534Z","etag":null,"topics":["jsx","ui-components","web-components"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaljach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-01T12:28:22.000Z","updated_at":"2023-11-09T10:50:34.000Z","dependencies_parsed_at":"2023-11-16T17:46:06.984Z","dependency_job_id":null,"html_url":"https://github.com/michaljach/htm0","commit_stats":null,"previous_names":["michaljach/wc","michaljach/htm0"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fhtm0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fhtm0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fhtm0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaljach%2Fhtm0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaljach","download_url":"https://codeload.github.com/michaljach/htm0/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240810212,"owners_count":19861225,"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":["jsx","ui-components","web-components"],"created_at":"2024-11-11T04:24:29.764Z","updated_at":"2026-05-07T19:01:51.915Z","avatar_url":"https://github.com/michaljach.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# htm0\n\nFast and elegant Web Components framwork\n\n- super simple\n- 0 dependency\n- super small (2 KB)\n- super fast (~47ms FCP)\n- native web components\n- jsx support\n- vitual dom\n- shared state\n- local state\n- events\n\n## Install\n\n```\nnpm i htm0\n```\n\n## Example Component\n\n```\nimport { Component } from 'htm0';\n\nclass AppComponent extends Component {\n  render() {\n    return (\n      \u003cdiv class=\"app\"\u003e\n        Hello World !\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\n## Example Stateful Component\n\n```\nimport { Component } from 'htm0';\n\nclass AppComponent extends Component {\n    state = {\n        username: 'Michael'\n    }\n\n  render() {\n    return (\n      \u003cdiv class=\"app\"\u003e\n        {this.state.username}\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\n## Example Shared State\n\n```\nimport { Component, data } from 'htm0';\nimport { userData } from './userData'\n\n@data(userData, 'user')\nclass AppComponent extends Component {\n  render() {\n    return (\n      \u003cdiv class=\"app\"\u003e\n        {this.user.username}\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\n```\nimport { Data } from \"framework\";\n\nclass UserData extends Data {\n  data = {\n    username: \"Michael\",\n  };\n}\n\nexport const userData = new UserData();\n```\n\n## Example Event\n\n```\nimport { Component } from 'htm0';\n\nclass AppComponent extends Component {\n  click() {\n    console.log('hi');\n  }\n\n  render() {\n    return (\n      \u003cbutton click={this.click}\u003eclick me\u003c/button\u003e\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaljach%2Fhtm0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaljach%2Fhtm0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaljach%2Fhtm0/lists"}