Radio

ARIA
RTL

Radio buttons are used to represent a group of choices whereby users can only select one option.

The main difference between the radio button and the checkbox is, users are allowed to select single options whereas in the checkbox you can have multiple options.

Based on Headless UI.

Radio

Anatomy

<Radio>
  <Radio.Option>
    <Radio.Indicator />
    ...
  </Radio.Option>
</Radio>

Default

Disabled

As form item

Uncontrolled

Customization

Radio props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNo-Children of Radio
classNamestringNo-Tailwind classes for customization
defaultValuestring | numberNo-Default value of uncontrolled Radio
disabledbooleanNo-Disabled state of Radio
namestring | numberNo-Name of Radio when using inside a form
setValueanyNo-Set value of Radio
valuestring | numberNo-Value of Radio

Radio.Option props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNo-Children of Radio.Option
classNamestringNo-Tailwind classes for customization
disabledbooleanNo-Disabled state of Radio
valuestring | numberNo-Value of Radio

Radio.Indicator props

NameTypeRequiredDefaultDescription
classNamestringNo-Tailwind classes for customization