Skip to content

Radio

A set of options where only one can be selected.

Density

Installation

  1. Add the registryOnce per project
  2. Add radio

Usage

Pair each Radio with a label in a FieldItem, and label the group with a FieldSet and a FieldLegend, from Field.

Without a visible legend, give the RadioGroup an aria-label instead.

Composition

Examples

With descriptions

Wrap the label in a FieldContent with a FieldDescription when an option needs explaining.

Visibility

Anyone with the link can view it.

Only people you invite can view it.

Disabled

Set disabled on a Radio, or on the RadioGroup to disable all of them.

Layout

Not available on small screens.

Read-only

Set readOnly on the RadioGroup to show the selected option without letting anyone change it. The radios stay focusable, and the value still submits with a form.

Data region

Choice cards

Set variant="card" on each FieldItem to frame it as a card. Its FieldLabel makes the whole card clickable.

Plan

Up to 3 projects and 5 members.

Unlimited projects and 25 members.

SSO, audit logs and priority support.

Invalid

Wrap the group in a Field, set invalid on it, and explain the problem with a FieldError.

Shipping speed

In a form

Wrap the group in a Field with a name, and the form submits the selected radio's value under it. Leave out defaultValue so that someone has to choose, and with required on the RadioGroup, the form won't submit until they do, failing validation with valueMissing.

Plan

Props

radioVariants() returns the classes that draw the circle. Use them to show a selected state on an element that isn't a control of its own.

Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.

Radio

RadioGroup