{"id":24911423,"url":"https://github.com/accessible-ui/radio","last_synced_at":"2026-04-27T00:31:51.879Z","repository":{"id":40795128,"uuid":"228709207","full_name":"accessible-ui/radio","owner":"accessible-ui","description":"🅰 An accessible and versatile radio component for React","archived":false,"fork":false,"pushed_at":"2023-01-06T02:21:29.000Z","size":2774,"stargazers_count":2,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-19T17:14:17.449Z","etag":null,"topics":["a11y","a11y-radio","a11y-radiogroup","a11y-react","accessible-radio","accessible-radiogroup","accessible-react","aria","aria-radio","aria-radio-component","radiogroup","react","react-radiogroup"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/accessibleradio-examples-olksf","language":"TypeScript","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/accessible-ui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-17T22:01:09.000Z","updated_at":"2020-08-06T08:45:22.000Z","dependencies_parsed_at":"2023-02-05T02:45:37.978Z","dependency_job_id":null,"html_url":"https://github.com/accessible-ui/radio","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/accessible-ui/radio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Fradio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Fradio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Fradio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Fradio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/accessible-ui","download_url":"https://codeload.github.com/accessible-ui/radio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Fradio/sbom","scorecard":{"id":162342,"data":{"date":"2025-08-11","repo":{"name":"github.com/accessible-ui/radio","commit":"7d2a33106992a4dc0337d1c4a129b0c44e537196"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"49 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T13:51:01.684Z","repository_id":40795128,"created_at":"2025-08-16T13:51:01.684Z","updated_at":"2025-08-16T13:51:01.684Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32318417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"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":["a11y","a11y-radio","a11y-radiogroup","a11y-react","accessible-radio","accessible-radiogroup","accessible-react","aria","aria-radio","aria-radio-component","radiogroup","react","react-radiogroup"],"created_at":"2025-02-02T04:20:06.611Z","updated_at":"2026-04-27T00:31:51.860Z","avatar_url":"https://github.com/accessible-ui.png","language":"TypeScript","readme":"\u003chr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003e\n    \u0026lt;Radio\u0026gt;\n  \u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@accessible/radio\"\u003e\n    \u003cimg alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/@accessible/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Types\" href=\"https://www.npmjs.com/package/@accessible/radio\"\u003e\n    \u003cimg alt=\"Types\" src=\"https://img.shields.io/npm/types/@accessible/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Code coverage report\" href=\"https://codecov.io/gh/accessible-ui/radio\"\u003e\n    \u003cimg alt=\"Code coverage\" src=\"https://img.shields.io/codecov/c/gh/accessible-ui/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Build status\" href=\"https://travis-ci.org/accessible-ui/radio\"\u003e\n    \u003cimg alt=\"Build status\" src=\"https://img.shields.io/travis/accessible-ui/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"NPM version\" href=\"https://www.npmjs.com/package/@accessible/radio\"\u003e\n    \u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/@accessible/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"https://jaredlunde.mit-license.org/\"\u003e\n    \u003cimg alt=\"MIT License\" src=\"https://img.shields.io/npm/l/@accessible/radio?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cpre align=\"center\"\u003enpm i @accessible/radio\u003c/pre\u003e\n\u003chr\u003e\n\nAn accessible radio component for React. This library allows you to create\nyour own a radio with your own styles while maintaining the ability to\nfocus and update a radio input with the keyboard.\n\n## Quick Start\n\n[Check out the example on **CodeSandbox**](https://codesandbox.io/s/accessibleradio-examples-olksf)\n\n```jsx harmony\nimport {RadioGroup, Radio, Mark} from '@accessible/radio'\n\nconst MyRadio = () =\u003e (\n  \u003cRadioGroup name='favorite_food' defaultValue='pizza'\u003e\n    \u003ch2\u003eWhat is your favorite food?\u003c/h2\u003e\n\n    \u003clabel\u003e\n      \u003cRadio value='pizza'\u003e\n        \u003cspan className='my-radio'\u003e\n          \u003cMark checkedClass='checked' uncheckedClass='unchecked'\u003e\n            \u003cspan className='mark' /\u003e\n          \u003c/Mark\u003e\n        \u003c/span\u003e\n      \u003c/Radio\u003e\n      Pizza\n    \u003c/label\u003e\n\n    \u003clabel\u003e\n      \u003cRadio value='tacos'\u003e\n        \u003cspan className='my-radio'\u003e\n          \u003cMark checkedClass='checked' uncheckedClass='unchecked'\u003e\n            \u003cspan className='mark' /\u003e\n          \u003c/Mark\u003e\n        \u003c/span\u003e\n      \u003c/Radio\u003e\n      Tacos\n    \u003c/label\u003e\n  \u003c/RadioGroup\u003e\n)\n```\n\n## API\n\n### \u0026lt;RadioGroup\u0026gt;\n\nCreates context that controls the child [`\u003cRadio\u003e`](#radio) components. This is also where you set\ncontrolled values and default values for the radio group.\n\n#### Props\n\n| Prop         | Type                                                                                  | Default     | Required? | Description                                                                                                                                                                                                                      |\n| ------------ | ------------------------------------------------------------------------------------- | ----------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| name         | `string`                                                                              | `undefined` | Yes       | The name of the checkbox group (applied to each child [`\u003cRadio\u003e`](#radio) input)                                                                                                                                                 |\n| value        | \u003ccode\u003evalue: string \u0026#0124; number \u0026#0124; string[] \u0026#0124; undefined\u003c/code\u003e          | `undefined` | No        | Makes the radio group a controlled component which can no longer be updated with the `setValue` control or any [`\u003cRadio\u003e`](#radio) controls. It should be the same as one of the values in the child [`\u003cRadio\u003e`](#radio) inputs. |\n| defaultValue | \u003ccode\u003evalue: string \u0026#0124; number \u0026#0124; string[] \u0026#0124; undefined\u003c/code\u003e          | `undefined` | No        | This sets the default radio group value. It should be the same as one of the values in the child [`\u003cRadio\u003e`](#radio) inputs.                                                                                                     |\n| onChange     | \u003ccode\u003e(value: string \u0026#0124; number \u0026#0124; string[] \u0026#0124; undefined) =\u003e any\u003c/code\u003e | `undefined` | No        | This callback fires each time the checked value changes                                                                                                                                                                          |\n| children     | `React.ReactNode`                                                                     | `undefined` | No        | Any React nodes, including your [`Radio`](#radio) inputs                                                                                                                                                                         |\n\n### useRadioGroup()\n\nA React hook that returns the [`RadioGroupContextValue`](#radiogroupcontextvalue) for the nearest `\u003cRadioGroup\u003e` parent.\n\n### RadioGroupContextValue\n\n```typescript\ninterface RadioGroupContextValue {\n  name: string\n  value: string | number | string[] | undefined\n  setValue: (\n    value:\n      | string``\n      | number\n      | string[]\n      | undefined\n      | ((\n          current: string | number | string[] | undefined\n        ) =\u003e string | number | string[] | undefined)\n  ) =\u003e void\n}\n```\n\n### \u0026lt;Radio\u0026gt;\n\nCreates a visually hidden radio input that is focusable and accessible via keyboard navigation.\nAll props passed to this component are applied to the `\u003cinput\u003e`. This also creates a context\nprovider enabling the other components in this library to access the radio's state\ndeep in the tree.\n\n#### Props\n\n| Prop     | Type                        | Default     | Required? | Description                                                  |\n| -------- | --------------------------- | ----------- | --------- | ------------------------------------------------------------ |\n| disabled | `boolean`                   | `false`     | No        | Disables this radio option                                   |\n| onChange | `(checked: boolean) =\u003e any` | `undefined` | No        | Called each time the `checked` state of this option changes. |\n| children | `React.ReactNode`           | `undefined` | No        | Your custom styled radio.                                    |\n\n### \u0026lt;Mark\u0026gt;\n\nA convenient component for conditionally adding class names and styles when the `\u003cRadio\u003e` component is checked/unchecked. It must be a child of a `\u003cRadio\u003e`.\n\n#### Props\n\n| Prop           | Type                  | Default     | Required? | Description                                                                         |\n| -------------- | --------------------- | ----------- | --------- | ----------------------------------------------------------------------------------- |\n| uncheckedClass | `string`              | `undefined` | No        | This class name will be applied to the child element when the radio is `unchecked`. |\n| checkedClass   | `string`              | `undefined` | No        | This class name will be applied to the child element when the radio is `checked`.   |\n| uncheckedStyle | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the radio is `unchecked`.    |\n| checkedStyle   | `React.CSSProperties` | `undefined` | No        | These styles name will be applied to the child element when the radio is `checked`. |\n| children       | `React.ReactNode`     | `undefined` | Yes       | The child you wish to render when the radio is checked.                             |\n\n### \u0026lt;Checked\u0026gt;\n\nThe child of this component will only render when the `\u003cRadio\u003e` is in\na `checked` state. It must be a child of a `\u003cRadio\u003e`.\n\n#### Props\n\n| Prop     | Type              | Default     | Required? | Description                                             |\n| -------- | ----------------- | ----------- | --------- | ------------------------------------------------------- |\n| children | `React.ReactNode` | `undefined` | Yes       | The child you wish to render when the radio is checked. |\n\n### \u0026lt;Unchecked\u0026gt;\n\nThe child of this component will only render when the `\u003cRadio\u003e` is in\nan `unchecked` state. It must be a child of a `\u003cRadio\u003e`.\n\n#### Props\n\n| Prop     | Type              | Default     | Required? | Description                                               |\n| -------- | ----------------- | ----------- | --------- | --------------------------------------------------------- |\n| children | `React.ReactNode` | `undefined` | Yes       | The child you wish to render when the radio is unchecked. |\n\n### useRadio()\n\nA React hook that returns the [`RadioContextValue`](#radiocontextvalue) for the nearest `\u003cRadio\u003e` parent.\n\n### RadioContextValue\n\n```typescript\ninterface RadioContextValue {\n  // Does the radio have a `checked` property?\n  checked: boolean\n  // Is the radio currently focused?\n  focused: boolean\n  // Is the radio currently disabled?\n  disabled: boolean\n  // Checks the radio\n  check: () =\u003e void\n  // Unchecks the radio\n  uncheck: () =\u003e void\n}\n```\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccessible-ui%2Fradio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccessible-ui%2Fradio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccessible-ui%2Fradio/lists"}