Radio group
Pick one of a few options. The picked colour wipes in from the start side, as the Checkbox's tick does.
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).
Rows
Set className="gap-0" for rows that sit against each other.
Inline
Lay the options out in a row with className; they wrap when the row is full.
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.
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- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
RadioGroup
Radio
Data attributes
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 witharia-labelledbypointing 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.