Radio Cards

Radio Cards

Forms
Selection

Selectable card-style radio inputs for choosing between options with rich content.

Preview

Card-based radio selection with icons

Grid Layout

Horizontal card grid for plan selection

Props

Radio Cards component API reference

PropTypeDefaultDescription
options*RadioCardOption[]—Array of selectable options
valuestring—Currently selected value (controlled)
defaultValuestring—Default selected value (uncontrolled)
onChange(value: string) => void—Change handler
layout'vertical' | 'grid''vertical'Card layout direction
columnsnumber3Grid columns (when layout is grid)
disabledbooleanfalseDisable all options (options also take their own disabled flag)
classNamestring—Additional CSS classes

Usage

Import and implementation example

import { RadioCards } from '@/components/ui/radio-cards'
const options = [
{ value: 'card', label: 'Credit Card', description: 'Pay with card', icon: CreditCard },
{ value: 'bank', label: 'Bank Transfer', description: 'Direct transfer', icon: Building2 },
]
<RadioCards
options={options}
value={selected}
onChange={setSelected}
layout="vertical"
/>

Features

Built-in functionality

  • Two layouts: Vertical list or horizontal grid
  • Rich content: Icons, descriptions, and pricing in cards
  • Selection indicator: Filled check badge, thicker border and tinted background on selection
  • Hover, focus and disabled states: Border hover, focus-visible ring and dimmed disabled cards
  • Keyboard navigation: Arrow keys to move between options

Accessibility

ARIA support and keyboard navigation

ARIA Attributes

role="radiogroup" on containerrole="radio" on each cardaria-checked for selection state

Keyboard Navigation

KeyAction
Arrow Up/DownMove between options
SpaceSelect focused option
TabMove focus in/out of group

Notes

  • Uses radio group pattern for single selection
  • Selected state communicated via aria-checked
  • Icon decorations are hidden from screen readers