Card-style single-selection component. Each card acts as a radio button, ideal for plan or option pickers.
import RadioCards from "@radui/ui/RadioCards"- Single-select where each option is a card with its own layout
- Arrow keys move the selection; the selected card is the group's one tab stop
- A hidden input submits the selected value under name and resets with the form
- Controlled with value and onValueChange, or uncontrolled with defaultValue
Import all parts of the component and piece them together.
The root RadioCards component.
| Prop | Type | Default |
|---|---|---|
name | string | — |
value | string | — |
defaultValue | string | — |
onValueChange | function | — |
| Shortcut | Description |
|---|---|
| Tab | Moves focus into or out of the radio card group. |
| ArrowRight | Moves focus to the next enabled radio card and selects it. |
| ArrowDown | Moves focus to the next enabled radio card and selects it. |
| ArrowLeft | Moves focus to the previous enabled radio card and selects it. |
| ArrowUp | Moves focus to the previous enabled radio card and selects it. |
| Space | Selects the focused radio card. |
| Reference | What Rad UI follows |
|---|---|
| Radio group pattern | Uses radio group semantics for at most one selected card when each card has a unique value, with each card exposed as a radio item. |