{"id":19605131,"url":"https://github.com/a7ul/webcomponents-with-react-webcomponentify","last_synced_at":"2025-04-27T19:32:45.390Z","repository":{"id":75754818,"uuid":"167849280","full_name":"a7ul/webcomponents-with-react-webcomponentify","owner":"a7ul","description":"Web components based components library using react-webcomponentify + (P) React. This repo showcases how you can build web components using react without much bundlesize overhead.","archived":false,"fork":false,"pushed_at":"2023-09-20T13:12:12.000Z","size":407,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T02:22:12.649Z","etag":null,"topics":["components","experiment","javascript","preact","react","reactjs","web","web-components"],"latest_commit_sha":null,"homepage":"https://www.atulr.com/webcomponents-with-react-webcomponentify/","language":"HTML","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/a7ul.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-27T19:27:50.000Z","updated_at":"2021-10-15T02:54:56.000Z","dependencies_parsed_at":"2024-11-11T09:52:10.208Z","dependency_job_id":null,"html_url":"https://github.com/a7ul/webcomponents-with-react-webcomponentify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fwebcomponents-with-react-webcomponentify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fwebcomponents-with-react-webcomponentify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fwebcomponents-with-react-webcomponentify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fwebcomponents-with-react-webcomponentify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a7ul","download_url":"https://codeload.github.com/a7ul/webcomponents-with-react-webcomponentify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251196139,"owners_count":21550909,"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":["components","experiment","javascript","preact","react","reactjs","web","web-components"],"created_at":"2024-11-11T09:41:18.897Z","updated_at":"2025-04-27T19:32:45.381Z","avatar_url":"https://github.com/a7ul.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Web components based components library using react-webcomponentify + React\n\nThis repo showcases how you can build web components using react without much bundlesize overhead. It uses \n\u003ca href=\"https://github.com/a7ul/react-webcomponentify\" target=\"_blank\" \u003ereact-webcomponentify\u003c/a\u003e.\n\n\u003cimg src=\"https://github.com/a7ul/react-webcomponentify/blob/master/assets/react-webcomponent.png\" width=\"200\" height=\"auto\" alt=\"logo\" style=\"display:block; margin:0 auto;\"/\u003e\n\nGo ahead and test it out here: \u003ca href=\"https://a7ul.github.io/webcomponents-with-react-webcomponentify\" target=\"_blank\" \u003e Link to components libarary\u003c/a\u003e\n\n**Pro Tip: Do try inspecting the elements using chrome dev tools**\n\nYou can also check the underlying source code in the inspector since I have enabled source maps.\n\n---\n\n# Why ?\n\nI suggest you read here:\n\nLink to **react-webcomponentify**: https://github.com/a7ul/react-webcomponentify\n\n---\n\n## How much overhead does react-webcomponentify add?\n\n**TLDR: 2.1kb**\n\n- With react-webcomponentify and components : 9.1kb after gzip\n- Without react-webcomponentify and only components: 7kb after gzip\n- Overhead caused by react-webcomponentify: 2.1kb after gzip for entire component library\n\n**Hence with react-webcomponentify + preact you can build a web component libarary with bundle size as small as 9kb**\n\n---\n\n## Wish to build your own web-component library with React like this one ?\n\n**Installation**\n\n- Clone this repo: https://github.com/a7ul/webcomponents-with-react-webcomponentify\n- `npm install`\n- `npm run start`\n- Add your components.\n- If you want to build: `npm run build`\n- The code is pretty self explanatory.\n\n---\n\n### This Component Library contains:\n\n- Button component : `\u003cmy-button text=\"some text\"\u003e\u003c/my-button\u003e`\n- Input Component : `\u003cmy-input\u003e\u003c/my-input\u003e`\n\n### Why I am using Preact in the examples ?\n\nWell If you look closely at package.json and webpack config, you will realize I am using preact here. You can go ahead and use React aswell. Everything will work as expected. Only downside is that React is a bit heavy as compared to Preact. Hence it will add to your bundle size. The example here will work 100% with React as Preact has extremely good compatibility with react.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7ul%2Fwebcomponents-with-react-webcomponentify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7ul%2Fwebcomponents-with-react-webcomponentify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7ul%2Fwebcomponents-with-react-webcomponentify/lists"}