Choice Card

Presents an option as a whole selectable card with a title and a supporting line.

Automatic

Deploys every approved change.

Manual

You confirm each change.

Configurations

Supported configurations for this component.

States

Interaction states covered by the API and the style contract.

Configurations

3 examples
Radio group

Automatic

Deploys every approved change.

Manual

You confirm each change.

Checkbox

Keep activity history

Store events for 90 days.

Send crash reports

Share errors so we can fix them.

Toggle

Status updates

Post status to your team channel.

Night mode

Dim the interface after hours.

States

7 examples
Hover

Keep activity history

Store events for 90 days.

Rest

Keep activity history

Store events for 90 days.

Hover
Focus visible

Keep activity history

Store events for 90 days.

Rest

Keep activity history

Store events for 90 days.

Focus visible
Disabled

Keep activity history

Store events for 90 days.

Selected

Keep activity history

Store events for 90 days.

Rest

Keep activity history

Store events for 90 days.

Selected
Selected hover

Keep activity history

Store events for 90 days.

Rest

Keep activity history

Store events for 90 days.

Selected hover
Disabled selected

Keep activity history

Store events for 90 days.

Disabled group

Automatic

Deploys every approved change.

Manual

You confirm each change.

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

ChoiceCard

PropTypeDefaultDescription
titlereqReact.ReactNode-Primary option name; display content only, with no nested interactive element.
descriptionReact.ReactNode-Optional supporting line; display content only, with no nested interactive element.
control'radio'|'checkbox'|'toggle''radio'Native control used as the state indicator.
valuestring-Native input value; required for radio cards inside ChoiceCardGroup.
checkedboolean-Controlled checked state.
defaultCheckedbooleanfalseInitial checked state in uncontrolled mode.
onCheckedChange(next: boolean) => void-Called with the next checked state.
size'md'|'lg''md'Size passed to the nested control.
disabledbooleanfalseDisables the native control and dims the whole card.
idstring-Native input id; auto-generated when omitted.
namestring-Native input name; a ChoiceCardGroup supplies this to radio cards.
classNamestring-Extra classes merged onto the Card root.
styleReact.CSSProperties-Inline styles merged onto the Card root.

ChoiceCardGroup

PropTypeDefaultDescription
namestring-Shared native name for the group's radio cards; auto-generated when omitted.
valuestring-Selected value in controlled mode.
defaultValuestring-Initially selected value in uncontrolled mode.
onValueChange(next: string) => void-Called with the newly selected value.
disabledbooleanfalseDisables every radio card in the group.
childrenReact.ReactNode-ChoiceCard elements using control="radio" and unique values.
classNamestring-Extra classes merged onto the radiogroup wrapper.
styleReact.CSSProperties-Inline styles merged onto the radiogroup wrapper.
aria-orientation'vertical'|'horizontal''vertical'Direction exposed to assistive technology; native radio arrow keys handle both axes.

More Andromeda Pro components