{"id":17072470,"url":"https://github.com/malcolm-kee/compound-component","last_synced_at":"2026-05-17T00:12:24.056Z","repository":{"id":96506815,"uuid":"171870644","full_name":"malcolm-kee/compound-component","owner":"malcolm-kee","description":"Repo for tech talk on compound component","archived":false,"fork":false,"pushed_at":"2019-02-27T13:28:53.000Z","size":468,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-20T18:33:04.661Z","etag":null,"topics":["compound-components","design-patterns","reactjs"],"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/malcolm-kee.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":"2019-02-21T12:47:49.000Z","updated_at":"2019-02-27T13:28:55.000Z","dependencies_parsed_at":"2023-04-30T19:01:31.792Z","dependency_job_id":null,"html_url":"https://github.com/malcolm-kee/compound-component","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malcolm-kee/compound-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcolm-kee%2Fcompound-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcolm-kee%2Fcompound-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcolm-kee%2Fcompound-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcolm-kee%2Fcompound-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malcolm-kee","download_url":"https://codeload.github.com/malcolm-kee/compound-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcolm-kee%2Fcompound-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33123124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: 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":["compound-components","design-patterns","reactjs"],"created_at":"2024-10-14T11:40:04.572Z","updated_at":"2026-05-17T00:12:24.039Z","avatar_url":"https://github.com/malcolm-kee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compound-component\n\nThis project demo few use cases of a React design patterns: Compound Component.\n\n## Purpose of Compound Component\n\n**Distribute the responsibilities** of view into multiple components while **sharing states between them**.\n\nAn example of compound component is `select` and `option` elements:\n\n1. `select` is responsible for determining the selected value\n1. `option` is responsible for the value and display of an option when it is selected.\n\n## When to use it\n\nWhen you have a big component that responsible for few UI components, but you need to share states between them.\n\nTake for example, a Tabs components that consists of the Tab buttons and the content of the Tabs. You can putting everything into a single `Tabs` component and passing all the props via it, but that means your `Tabs` component is taking a lot responsibility e.g.\n\n- where the tab button is placed\n- the contents of the tab button\n- the contents for each Tab\n\n## Other Details\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcolm-kee%2Fcompound-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalcolm-kee%2Fcompound-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcolm-kee%2Fcompound-component/lists"}