Skip to content

Inputs

Radio group

One choice from a small set, shown all at once. Use the list style for simple options and the card style when each option needs a description, an icon or a price. It's built on native radios, so the keyboard behaviour comes for free.

On this page
Plan

You can switch plans at any time.

Usage

components/ui/radio-group.tsx
import { Radio, RadioGroup } from "@/components/ui/radio-group"; export function Example() {  return (    <RadioGroup label="Billing cycle" defaultValue="monthly">      <Radio value="monthly" label="Monthly" />      <Radio value="yearly" label="Yearly" description="Two months free." />    </RadioGroup>  );}

Examples

Cards

Plan

You can switch plans at any time.

List

When a payment fails

Horizontal

Invoice language

Disabled and error

Payout schedule
Tax treatment

Choose how VAT is applied.

Props

RadioGroup

  • labelrequiredReactNodedefault: —Legend for the group.
  • hideLabelbooleandefault: falseKeep the legend for screen readers only.
  • descriptionReactNodedefault: —Help text under the legend.
  • errorReactNodedefault: —Error message; marks the group invalid.
  • value / defaultValuestringdefault: —Controlled or initial selected value.
  • onValueChange(value: string) => voiddefault: —Called when the selection changes.
  • variant"list" | "card"default: "list"Plain rows or bordered cards.
  • orientation"vertical" | "horizontal"default: "vertical"List layout direction.
  • columns1 | 2 | 3default: 1Card columns from the sm breakpoint.
  • namestringdefault: —Form field name. Generated when omitted.
  • disabled / requiredbooleandefault: —Apply to the whole group.

Radio

  • valuerequiredstringdefault: —Value submitted when selected.
  • labelrequiredReactNodedefault: —Option title.
  • descriptionReactNodedefault: —Second line.
  • metaReactNodedefault: —Card only: right side of the title row, e.g. a price.
  • iconReactNodedefault: —Card only: icon above the title.
  • disabledbooleandefault: —Disable this option.

Accessibility

  • Native radios share one name: Tab enters the group on the selected option, arrow keys move and select, Tab leaves the group.
  • The group is a <fieldset role="radiogroup"> with a <legend>, so the question is announced with each option.
  • Descriptions are linked to each radio with aria-describedby.
  • In the card style the whole card is the label, so it's one large click target; the focus ring wraps the card.
  • Selected cards get a thicker accent border and a filled radio, not just a tint.

Suggested