Skip to content

RadioCard

Card-style radio button with label and description.

Also known as: selection card, option card with radio, plan card

View in Storybook

When to use

  • Rich radio selection with label and description (plan selection, preference cards). For simple radios, use Radio.
  • For checkbox cards, use CheckboxCard.

Import

tsx
import { RadioCard } from '@vacano/ui'

Usage

tsx
const [selected, setSelected] = useState('basic')

<RadioCard
  checked={selected === 'basic'}
  onChange={() => setSelected('basic')}
  label="Basic Plan"
  description="For individuals and small teams"
  name="plan"
/>
<RadioCard
  checked={selected === 'pro'}
  onChange={() => setSelected('pro')}
  label="Pro Plan"
  description="For growing businesses"
  name="plan"
/>

Full Width

tsx
<RadioCard
  fullWidth
  checked={true}
  onChange={() => {}}
  label="Full Width Card"
  description="Takes full container width"
/>

Variants

tsx
<RadioCard variant="normal" checked={true} onChange={() => {}} label="Normal" />
<RadioCard variant="error" checked={true} onChange={() => {}} label="Error" />

Disabled

tsx
<RadioCard disabled checked={true} onChange={() => {}} label="Disabled" />

Props

PropTypeDefaultDescription
checkedbooleanrequiredChecked state
onChangeChangeEventHandler<HTMLInputElement>requiredChange handler
labelstringrequiredLabel text
descriptionstring-Description text
fullWidthbooleanfalseFull width card
variant'normal' | 'error''normal'Visual variant
disabledbooleanfalseDisable card
namestring-Input name for grouping
classNamestring-CSS class for root element
classnamesRadioCardClassNames-Custom class names for inner elements
refRef<HTMLInputElement>-Ref to the underlying input element
data-test-idstring-Test identifier for automated testing

Also accepts all standard InputHTMLAttributes<HTMLInputElement> except type, checked, onChange, and className.

ClassNames

KeyDescription
radioRadio element
contentContent container
labelLabel text
descriptionDescription text

Released under the MIT License.