Skip to content

Radio group

Selects one option from a short visible list.

Workspace plan
radio-group-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Composition

  • RadioGroup

    Owns the selected value. Lays out its children by orientation.

    • RadioGroupLabel
    • RadioGroupDescription
    • RadioGroupItemsOptional

      Changes the gap between choices.

      • RadioFieldRepeats
        • RadioButton

          Its text becomes the accessible name.

          • RadioIndicator
          • RadioLabel
        • RadioDescription
    • RadioGroupError

Radio Renders RadioField and its parts from children and description. Use the parts only for a custom layout.

Described options

Notifications
Every comment, change, and mention.
Only when someone mentions you.
No notifications.
radio-group-description-demo.tsx

Horizontal

Size
radio-group-horizontal-demo.tsx

Card options

Compose the RadioField parts to put content beside the label.

Plan
One project.
Unlimited projects.
Shared billing.
radio-group-card-demo.tsx

Disabled

Set isDisabled on one Radio, or on RadioGroup for all options.

Region
Not available on your plan.
radio-group-disabled-demo.tsx

Required

The error shows after the first submit. Also install Form and Button.

Delivery speed
3 to 5 business days.
Next business day.
radio-group-required-demo.tsx

API reference

vip/ui adds or changes the props below. For all other props, see React Aria RadioGroup (opens in a new tab).

RadioGroup

label: ReactNode
The label of the group. Without it, pass aria-label or compose RadioGroupLabel.
description: ReactNode
Help text for the group, below the label.
errorMessage: string | ((validation: ValidationResult) => string)
Shown below the options when the group is invalid. Without it, the browser validation message shows. With label, description, or errorMessage, the group adds RadioGroupError for you.
onValueChange: (value: string) => void
Alias for onChange. Both run when both are set.

Radio

children: ReactNode
The label. Without it, pass aria-label so the option has a name.
description: ReactNode
Help text below the label. Linked with aria-describedby, so it is not part of the name.
variant: "default" | "card" = "default"
Selects the plain or card appearance. A card selects the option from anywhere inside it. RadioField takes the same prop.