RadioGroup

Clear choices, from simple radio lists to full selectable cards with icons, descriptions, and pricing. Native keyboard and form behavior included.

Preview

Live previewCustomize theme
ROOM TO GROW

Find your starting point.

A choice should feel clear before you make it.

Choose your workspace
Delivery preference

Import

tsx
import { RadioGroup } from '@velocityuikit/velocityui'

Props

PropTypeDefaultDescription
namestring—Shared name attribute for the radio inputs.
labelstring—Group label rendered as a <legend>.
optionsRadioOption[]—Array of { value, label, description?, icon?, meta?, disabled? }. Icons and metadata should be non-interactive content.
variant'default' | 'cards''default'Render simple radio options or selectable cards with a full clickable surface.
valuestring—Controlled selected value.
defaultValuestring—Uncontrolled default selected value.
onChange(value: string) => void—Callback fired when selection changes.
orientation'vertical' | 'horizontal''vertical'Layout direction of the radio options.
size'sm' | 'md' | 'lg''md'Controls radio and label size.
errorstring—Error message for the entire group.

Examples

Selectable cards

The whole card selects the native radio. Arrow keys and form submission continue to work without extra handlers.

tsx
import { RadioGroup } from '@velocityuikit/velocityui'

export default function Plans() {
  return <RadioGroup
    name="plan"
    label="Choose your workspace"
    variant="cards"
    defaultValue="team"
    options={[
      { value: 'personal', label: 'Personal', description: 'For side projects', meta: 'Free' },
      { value: 'team', label: 'Team', description: 'Build together', meta: '$12 / month' },
    ]}
  />
}

Basic

tsx
import { RadioGroup } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <RadioGroup
      name="plan"
      label="Select a plan"
      defaultValue="pro"
      options={[
        { value: 'free', label: 'Free', description: 'Up to 3 projects' },
        { value: 'pro', label: 'Pro', description: 'Unlimited projects' },
        { value: 'enterprise', label: 'Enterprise', description: 'Custom pricing' },
      ]}
    />
  )
}

Horizontal

tsx
import { RadioGroup } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <RadioGroup
      name="size"
      label="T-shirt size"
      orientation="horizontal"
      options={[
        { value: 's', label: 'S' },
        { value: 'm', label: 'M' },
        { value: 'l', label: 'L' },
        { value: 'xl', label: 'XL' },
      ]}
    />
  )
}

Theming

Apply a named theme class to <body> or any parent element. All VelocityUI components inside that element will automatically adopt its colors, shadows, and effects. Combine with a density modifier for complete control:

html
/* Pick any named theme */
<body class="vui-theme-ocean">

/* Add a density modifier (optional) */
<body class="vui-theme-midnight vui-density-compact">
<body class="vui-theme-construction vui-density-spacious">

/* Available themes */
/* default  midnight  ocean  dark-cyan  tangerine */
/* construction  glass  soft  high-contrast  monochrome-red */

/* Available densities */
/* vui-density-compact  vui-density-comfortable  vui-density-spacious */