Client component

Radio Card

A card-shaped radio: the whole surface is the click target, with room for a title, description and leading addon. It joins Radio.Group exactly like Radio does: give it a value inside a group for single selection.

Import#

import { RadioCard, Radio } from "astralis-ui";

Usage#

Put the cards inside a Radio.Group and give each a value. The group owns the selection and the shared name, so the choice submits with a native form and the arrow keys move between cards like any radio set. Reach for Radio Card over plain radios when each option needs a description, such as a pricing plan or a delivery method.

Props#

Extends the native radio input's props, plus:

PropTypeDefaultDescription
childrenReactNodeNoneCard title.
descriptionReactNodeNoneSecondary line under the title.
addonReactNodeNoneLeading slot for an icon or avatar.
valuestringNoneThe value this card selects inside a Radio.Group.
indicatorbooleantrueShows a tick in the corner while selected.
size"sm" | "md" | "lg""md"Padding and text scale.
colorSchemeall 15 schemes"brand"Hue of the selected card.
invalidbooleanfalseError styling and aria-invalid.
disabledbooleanfalseBlocks selection. Inherited from a Radio.Group or Field.

Keyboard#

KeyAction
TabInto the group: one tab stop, on the selected card
← ↑ / → ↓Select the previous / next card
SpaceSelect the focused card, when none is selected yet

For multiple selection, use Checkbox Card.