{"id":16295905,"url":"https://github.com/hamlim/react-slot-fill","last_synced_at":"2026-02-25T22:32:25.827Z","repository":{"id":74220925,"uuid":"90920051","full_name":"hamlim/react-slot-fill","owner":"hamlim","description":"A simple react implementation of web-component's slot mechanism.","archived":false,"fork":false,"pushed_at":"2017-05-13T22:48:36.000Z","size":4,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-10T12:11:32.248Z","etag":null,"topics":["components","higher-order-component","react","reactjs","webcomponents"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/hamlim.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":"2017-05-11T00:26:42.000Z","updated_at":"2025-04-12T16:11:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff53547b-122e-4bc5-858f-e7d78c097a47","html_url":"https://github.com/hamlim/react-slot-fill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hamlim/react-slot-fill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamlim%2Freact-slot-fill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamlim%2Freact-slot-fill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamlim%2Freact-slot-fill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamlim%2Freact-slot-fill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamlim","download_url":"https://codeload.github.com/hamlim/react-slot-fill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamlim%2Freact-slot-fill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29843433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T21:18:31.832Z","status":"ssl_error","status_checked_at":"2026-02-25T21:18:29.265Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","higher-order-component","react","reactjs","webcomponents"],"created_at":"2024-10-10T20:20:13.493Z","updated_at":"2026-02-25T22:32:25.810Z","avatar_url":"https://github.com/hamlim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Slot-Fill\n\n\n*** Not ready for primetime yet ***\n\n\nReact-Slot-Fill is a simple implementation of a component rendering pattern that is\ndeveloped to mimic web-component's `\u003cslot name\u003e` API.\n\n## Why?\n\nThis pattern was developed to avoid messy props-as-nodes components like this:\n\n```Javascript\n\u003cCustomComponent\n  someSpecialProp={\n    \u003cdiv\u003e\n      \u003cp\u003eSome other jsx here, potentially other components and things\u003c/p\u003e\n    \u003c/div\u003e\n  }\n/\u003e\n```\n\nUsing React-Slot-Fill, the above example can become far more composable:\n\n```Javascript\n\u003cCustomComponent\u003e\n  \u003cFill name=\"someSpecialProp\"\u003e\n    \u003cdiv\u003e\n      \u003cp\u003eSome other jsx here, potentially other components and things\u003c/p\u003e\n    \u003c/div\u003e\n  \u003c/Fill\u003e\n\u003c/CustomComponent\u003e\n```\n\nThis above is a bit of a contrived example because if you only need to insert one thing into the CustomComponent, then `props.children` would be a far more suitable solution.\n\n\n## How do I use this?\n\nWhen designing your components, you can use `\u003cFill\u003e` as a placeholder for whatever you want the implementor to render inside the component.\n\n```Javascript\nconst MyCustomComponent = props =\u003e (\n  \u003cdiv\u003e\n    \u003cp\u003esome internal content not affected by `React-Slot-Fill`\u003c/p\u003e\n    \u003cFill name=\"name\" /\u003e\n    \u003cp\u003eSome more internal content\u003c/p\u003e\n  \u003c/div\u003e\n);\n```\n\nWhere:\n\n * `\u003cFill\u003e` accepts one prop `name` that is used to match it to a `\u003cSlot\u003e`\n\n\nThen when you want to use your component you can do the following:\n\n```Javascript\nconst MyApp = props =\u003e (\n \u003cmain\u003e\n   \u003cp\u003esome app content\u003c/p\u003e\n   \u003cMyCustomComponent\u003e\n     \u003cSlot as=\"name\"\u003e\n       \u003cp\u003esome content that will be inserted into the associated `\u003cFill\u003e`\u003c/p\u003e\n     \u003c/Slot\u003e\n   \u003c/MyCustomComponent\u003e\n \u003c/main\u003e\n)\n```\n\n## Examples:\n\nPlease see [/examples/examples.md](/examples/examples.md)\n\n\n### NOTES:\n\nThis is an extremely early API, there are plenty of untested edge cases. Feel free to browse through the Github issues for notes on things I plan on working on soon, or to post general questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamlim%2Freact-slot-fill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamlim%2Freact-slot-fill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamlim%2Freact-slot-fill/lists"}