Skip to contentKino
Skip to Content

Radio group

Pick one of a few options. The picked colour wipes in from the start side, as the Checkbox's tick does.

npx shadcn add https://kinoui.com/r/radio-group.json
Share on

Examples

Default

Wrap each radio in a <label> with its text. The picked colour wipes in from the start side, and the old pick wipes back out. For options as cards, use the Radio cards (opens in a new tab).

Request a review

LED-482 · Invoice totals are off by a cent
Priya Raman will be notified

Rows

Set className="gap-0" for rows that sit against each other.

Preferences

Only for you, on every device.

Week starts on

Show estimates as

Inline

Lay the options out in a row with className; they wrap when the row is full.

Cancel your subscription

Ledger stays on Team until 30 November.

Why are you cancelling?

Pick a reason to cancel.

Invalid

Set aria-invalid on each radio once the person tries to go on without a pick, and point the group’s aria-describedby at the reason.

Data region

Set by your admin for everyone at Ledger.

Disabled

A disabled group fades and can’t be changed; disabled on one radio turns off only that option. Say why beside it.

Installation

npx shadcn@latest add https://kinoui.com/r/radio-group.json
Files
lib/reduce-motion.tslib/resize.tslib/choice.tscomponents/kino/radio-group.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

RadioGroup

PropTypeDefaultDescription
valuestringNoneThe picked value, when you hold the state.
defaultValuestringNoneThe value picked at first, when it holds its own state.
onValueChange(value, details) => voidNoneCalled with the new value when another radio is picked.
disabledbooleanfalseTurns off every radio in the group.
requiredbooleanfalseThe form can’t be sent until a radio is picked.
namestringNoneThe field’s name when the group is in a <form>.

Radio

PropTypeDefaultDescription
valuestringNoneThe value the group takes when this radio is picked.
disabledbooleanfalseTurns off this option only.
aria-invalidbooleanNoneDraws it in the destructive colour, with a ring.

Data attributes

AttributeOnDescription
data-checkedRadioPresent while it is picked. Style its card with has-data-checked:.
data-disabledRadio, RadioGroupPresent while it is disabled. Style its label with has-data-disabled:.

Accessibility

  • It follows the radio group pattern: Tab moves into the group at the picked radio, and the arrow keys move the pick.
  • Name the group with aria-label, or with aria-labelledby pointing at its visible heading.
  • A radio with no text beside it needs aria-label, such as "Small".
  • The picked radio shows a filled disc with a dot in the middle, so the pick never relies on colour. In forced colours the disc fills with the system highlight.
  • When the system asks for less motion, the disc appears at once.