Skip to main content

Radio

Use Radio Buttons to offer a visible list of choices where only a single selection is possible. Only one Radio Button of a group can be active at a time. You must never use single Radios, you might need to use a Checkbox or a Switch instead.

Example

Live Editor
Result
Loading...

Usage Rules

Do:

  • Have one option (usually the most desired one) set by default
  • Layout your option list vertically, with one choice per line
  • Use active wording and avoid negations in labels
  • Use Radio button instead of a Select if there are less than 4 options to choose from

Don’t:

  • Use as action buttons
  • Use if multiple options can be selected
  • Use to toggle items on or off. Use Switch instead

Variants

Disabled

Live Editor
Result
Loading...

Icons

Using prefixIcon or suffixIcon to render the icon and colorIcon to color the icon, the default color is ColorNeutral140 (#191d2f).

Live Editor
Result
Loading...

Helper Text

You can add an extra description to radio using helperText.

Live Editor
Result
Loading...

Ref

You can access to the input native element using ref.

Live Editor
Result
Loading...

Props

NameTypeDefault
name *
Native HTML attribute: Link
string
value *
Native HTML attribute: Link
string | number
disabled
Native HTML attribute: Link
boolean
css
Add custom styles to this component. Use with caution. Learn more here: Link
SupportedStyleAttributes
inputFieldCss
SupportedStyleAttributes
label
The label for the radio
string
aria-label
Provide at least one label(visual or non-visual) property for better accessibility. Check Accessibility page for more info: Link
string
aria-labelledby
Provide at least one label(visual or non-visual) property for better accessibility. Check Accessibility page for more info: Link
string
id
Native HTML attribute: Link
string
checked
Native HTML callback: Link
boolean
required
Native HTML attribute: Link
boolean
readOnly
Native HTML attribute: Link
boolean
onChange
Native HTML callback: Link
ChangeEventHandler<HTMLInputElement>
helperText
HelperText for radio
string
tabIndex
Tab index
number
prefixIcon
The prefix icon
"AddValue" | "AppGrid" | "ArrowCircleLeft" | "ArrowCircleRight" | "ArrowDown" | "ArrowDownLeft" | "A...
suffixIcon
The suffix icon
"AddValue" | "AppGrid" | "ArrowCircleLeft" | "ArrowCircleRight" | "ArrowDown" | "ArrowDownLeft" | "A...
colorIcon
The color of icon
string
ref
Ref<HTMLInputElement>
key
Key | null
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.