Skip to content

Components

Radio Cards

Choose one of a few cards that each show their option, like a colour palette.

Palette

Import

import { RadioCards, RadioCard } from '@rinzai/zen';

API reference

<RadioCards>

A choice of one among a few cards, each showing what it picks (a palette, a plan). Native radio inputs underneath, so arrow keys and forms work as for any radio group. Lay the cards out with className (e.g. a grid); fill it with RadioCard. For short text options, use Segmented.

PropTypeDefault
childrenRequired

The RadioCards.

ReactNode—
className

Classes for the cards' container: its layout (e.g. a grid).

string—
defaultValue

The first chosen card, when the group keeps its own.

string—
label

Shown above the cards, naming the group. Without it, give the group an aria-label or aria-labelledby.

string—
name

Form field name; defaults to a generated one.

string—
onValueChange
((value: V) => void)—
value

The chosen card, when you keep it.

string—

<RadioCard>

One card: a native radio covering whatever you put inside, so the whole card is the click target. Outlined, lit when chosen; style it further with className and style (e.g. a background showing the choice).

PropTypeDefault
valueRequired
string—
className
string—
disabled

Can't be chosen (and the arrow keys skip it).

boolean—
style
CSSProperties—