Radio cards
Pick one of a few options, each a card. The tint spreads from where you pressed, as the old pick’s drains away.
npx shadcn add https://kinoui.com/r/radio-cards.jsonCopy install command
Examples
Default
Each card is the radio, so a press anywhere on it picks it. The tint spreads from where you pressed until it fills the card, while the old pick’s drains away.
Rows
Set className="grid-cols-1" for one card per row, and lay a card out in a row with an icon at its start.
Invalid
Set aria-invalid on each card once the person tries to go on without a pick, and point the group’s aria-describedby at the reason.
Disabled
disabled on one card turns off only that option; say why on the card. disabled on the group turns off every card.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/radio-cards.json- Files
lib/reduce-motion.tslib/resize.tslib/choice.tscomponents/kino/radio-group.tsxcomponents/kino/radio-cards.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
RadioCards
RadioCard
Data attributes
Accessibility
- It follows the radio group pattern: Tab moves into the group at the picked card, and the arrow keys move the pick.
- Each card is read out by its
RadioCardTitle, then itsRadioCardDescription. Name the group witharia-label, or witharia-labelledbypointing at its visible heading. - The picked card shows its radio’s filled disc and a primary border, so the pick never relies on the tint. In forced colours the border and the disc take the system highlight.
- When the system asks for less motion, the tint fades in place and the disc appears at once.