Radio
Card Radio Group
A radio group of selectable cards whose highlight and dot spring from card to card.
npx motionsnack add card-radio-groupCustomize
Error Colour
<CardRadioGroup />Props
19 properties
| Property | Type | Default | Description |
|---|---|---|---|
| options | { value: string; title: string; description?: string; meta?: string; disabled?: boolean }[] | 3 demo plans | The cards, top to bottom. |
| value | string | - | Selected value. With a value the component is controlled. |
| onChange | (value: string, option?: CardRadioOption) => void | - | Called with the value of the card the user picked, and the option. |
| id | string | generated | Id prefix of the radios. |
| accent | string | - | Deprecated, no effect: the checked state is monochrome. |
| radius | number | - | Deprecated, no effect: option cards are radius 12. |
| gap | number | - | Deprecated, no effect: cards stack with an 8px gap. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'Choose a plan' | Legend above the group, also its accessible name. An empty string hides it. |
| defaultValue | string | 'pro' | Value selected at the start when the component is uncontrolled. |
| name | string | '' | Field name. With a value the selection is sent with the surrounding form. |
| helperText | string | '' | Small text under the cards. Empty hides it. |
| error | string | '' | Error message. Any text colours the unchecked radios' edge and replaces the helper text. |
| errorColor | string | '' | Overrides the per-theme error colour. Empty uses the theme pair. |
| required | boolean | false | A card must be picked before the form submits. |
| disabled | boolean | false | Disables every card. |
| showRadio | boolean | true | Radio circle at the start of every card. |
| bounce | number | 0.3 | Bounce of the spring that moves the highlight. |
| duration | number | 0.5 | Seconds the highlight takes to settle. |
About Card Radio Group
A radio group drawn as a column of cards, each with a title, a description and an optional price or note on the right. The accent border with its soft glow is one shared element: choosing another card makes it travel there and settle with a spring, and the radio dot flies along with it. Arrow keys, Home and End move the selection with a roving tabindex, so the group is a single stop in the tab order. It works controlled through value and onChange or uncontrolled through defaultValue, and with a name the choice is sent with a form. With reduced motion the highlight moves without animation.
What's included
- Border highlight that springs between cards
- Radio dot that travels with the selection
- Title, description and price or meta per card
- Arrow keys, Home and End with roving tabindex
- Controlled and uncontrolled value
- Optional hidden input for forms
- Light and dark, accent colour as a prop
- Type
- Animated React radio component
- Library
- Components · Radio
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-09-20
- Install
npx motionsnack add card-radio-group