Forms

Radio Group

A set of radio buttons that allows users to select only one option from a predefined list.

Basic

A set of round buttons where you can select only one option from the group.

Loading...

Installation

npx shadcn@latest add @intentui/radio

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

This component comes packed with several components to enhance functionality and provide a seamless experience.

Manual installation

npm i react-aria-components

Anatomy

import { Description, Label } from "@/components/ui/field"
import { Radio, RadioGroup } from "@/components/ui/radio"
<RadioGroup name="billing">
  <Label>Billing Cycle</Label>
  <Description>
    Select how often you'd like to be billed
  </Description>

  <Radio value="monthly">
    <Label>Monthly</Label>
    <Description>Billed every month</Description>
  </Radio>
  <Radio value="quarterly">
    <Label>Quarterly</Label>
    <Description>Billed every 3 months</Description>
  </Radio>
  <Radio value="yearly">
    <Label>Yearly</Label>
    <Description>
      Billed once per year with a discount
    </Description>
  </Radio>
</RadioGroup>

Orientation

By default, the radio group is vertically oriented. You can change it to a horizontal orientation by using the orientation prop.

Loading...

Without label

The label is optional. You can omit it if not needed.

Description

Add a description to the radio group by passing the description prop.

Loading...

Validation

Try submit the form without selecting any radio option to see the validation error.

Loading...

Controlled

You can control the radio group value using the value prop.

Loading...

Uncontrolled

You can control the radio group value using the defaultValue prop.

Loading...

Disabled

When the radio group is disabled, it cannot be interacted with.

Loading...
Unlock the full power of
Design Intent UI
Build modern web apps faster with 350+ blocks and polished templates crafted for professionals.
Explore