{"id":22403358,"url":"https://github.com/springload/segmented-control","last_synced_at":"2025-07-31T16:31:58.128Z","repository":{"id":20531070,"uuid":"23810265","full_name":"springload/segmented-control","owner":"springload","description":"A simple, CSS-driven way to create a segmented control using a list of radio buttons and labels.","archived":false,"fork":false,"pushed_at":"2014-09-09T00:00:09.000Z","size":138,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-04-16T06:38:43.833Z","etag":null,"topics":["css","radio-buttons"],"latest_commit_sha":null,"homepage":null,"language":"CSS","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/springload.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}},"created_at":"2014-09-08T22:09:03.000Z","updated_at":"2024-01-20T12:28:12.000Z","dependencies_parsed_at":"2022-07-23T05:47:36.244Z","dependency_job_id":null,"html_url":"https://github.com/springload/segmented-control","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/springload%2Fsegmented-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fsegmented-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fsegmented-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fsegmented-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/segmented-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228267806,"owners_count":17893841,"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":["css","radio-buttons"],"created_at":"2024-12-05T09:16:55.134Z","updated_at":"2024-12-05T09:16:55.758Z","avatar_url":"https://github.com/springload.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"segmented-control\n=================\n\nA simple, CSS-driven way to create a segmented control using a list of radio buttons and labels.\n\nHere’s the markup:\n```html\n\u003cul class=\"segmented-control\"\u003e\n    \u003cli class=\"segmented-control__item\"\u003e\n        \u003cinput class=\"segmented-control__input\" type=\"radio\" value=\"1\" name=\"option\" id=\"option-1\" checked\u003e\n        \u003clabel class=\"segmented-control__label\" for=\"option-1\"\u003eThing 1\u003c/label\u003e\n    \u003c/li\u003e\n    \u003cli class=\"segmented-control__item\"\u003e\n        \u003cinput class=\"segmented-control__input\" type=\"radio\" value=\"2\" name=\"option\" id=\"option-2\" \u003e\n        \u003clabel class=\"segmented-control__label\" for=\"option-2\"\u003eThing 2\u003c/label\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n```\n\n\nAnd the CSS:\n```css\n.segmented-control {\n    display: table;\n    width: 100%;\n    margin: 2em 0;\n    padding: 0;\n}\n\n.segmented-control__item {\n    display: table-cell;\n    margin: 0;\n    padding: 0;\n    list-style-type: none;\n}\n\n.segmented-control__input {\n    position: absolute;\n    visibility: hidden;\n}\n\n.segmented-control__label {\n    display: block;\n    margin: 0 -1px -1px 0; /* -1px margin removes double-thickness borders between items */\n    padding: 1em .25em;\n\n    border: 1px solid #ddd;\n\n    font: 14px/1.5 sans-serif; \n    text-align: center;  \n\n    cursor: pointer;\n}\n\n.segmented-control__label:hover {\n    background: #fafafa;\n}\n\n.segmented-control__input:checked + .segmented-control__label {\n    background: #eee;\n    color: #333; \n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fsegmented-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Fsegmented-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fsegmented-control/lists"}