// preview in
saved for every page

Radio group

One choice out of a few options that are all visible at once. The group is a single tab stop; the arrow keys move and select.

Built on Base UIPattern WAI-ARIA Radio GroupClient componentSource ↗
minimal · light · #3fa34d
Plan
disabled
readOnly

Installation

Set up Camaleo once (Installation), then import what you need. Give the group a name with Fieldset and FieldsetLegend, and wrap each Radio in a Label.

import { RadioGroup, Radio, Fieldset, FieldsetLegend, Label } from "@camaleo/react";

Anatomy

A RadioGroup holds the value. Each Radio is a circle with a dot inside, named by the Label around it.

radioPro
[data-slot="radio-group"][data-slot="radio"] · [data-slot="radio-indicator"][data-slot="label"] text

Examples

Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above.

minimal · light · #3fa34d
Plan
Storage region

Lowest latency for customers in Brazil.

Closest to most US services.

Keeps data inside the EU.

With descriptions

When the names alone don't help people choose, add a line under each option and link it with aria-describedby.

Billing period

$24 per month, cancel anytime.

Controlled

Click an option. value and onValueChange let the rest of the screen react, here the price below.

Payment method

Required, with an error

Submit it empty. With no safe default, mark the group required and say what to do in the FieldError.

Send the sign-in code by

Add a phone number in your profile to use this.

A disabled option

Disable only the option that can't be used, and say how to unlock it. Arrow keys skip it.

Seat preference

In a row

Two or three short options can sit side by side. Longer labels read faster in a column.

Delivery (confirmed)

Read-only

On a review step, readOnly shows the choice and keeps it focusable, unlike disabled, which fades it out.

In context

Radio groups ask one question at a time. These are whole pieces of UI you can copy, in the skin you picked.

Checkout

Shipping speed

Total

$93.99
Shipping speedCard · RadioGroup · Separator · Button

Appearance

Applies to this device only.

Theme
Density
Appearance settingsCard · Fieldset · RadioGroup

Cancel your plan

You keep Pro until Nov 30, 2026.

What’s the main reason?
Cancellation surveyCard · RadioGroup · Textarea · Button

Guidelines

DoA checkbox for a single yes.

People can tick it and untick it again.

Don’tA radio button on its own.

Once it is picked it can't be unpicked, so a lone radio traps people.

Team size
DoOptions that don't overlap.

Each answer fits exactly one option.

Team size
Don’tRanges that share an edge.

A team of 10 fits two options, so people guess.

Props

PropTypeDefaultDescription
disabledbooleanfalseWhether the component should ignore user interaction.
readOnlybooleanfalseWhether the user should be unable to select a different radio button in the group.
requiredbooleanfalseWhether the user must choose a value before submitting a form.
namestring—Identifies the field when a form is submitted.
valueany—The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
defaultValueany—The uncontrolled value of the radio button that should be initially selected. To render a controlled radio group, use the value prop instead.
onValueChange(value, details) => void—Callback fired when the value changes.

Radio takes a required value (what the group reports when it is picked) and disabled. Native attributes pass through.

Styling hooks

Restyle it without forking: target the attributes, or set the tokens on a parent, a skin or the group itself.

Attributes

data-slot"radio-group" · "radio" · "radio-indicator"
data-checkedpresent on the picked radio
data-uncheckedpresent on the others
data-disabledpresent when disabled
data-readonlypresent when read-only
data-invalidpresent when its Field is invalid

Tokens it reads

Color

--cml-accent--cml-accent-fg--cml-border-control--cml-check-on-border--cml-check-shadow--cml-field-bg--cml-focus-offset--cml-focus-ring--cml-focus-width

Shape & size

--cml-check-border-width--cml-check-size--cml-font-size-field--cml-gap--cml-radius-check--cml-radius-pill--cml-radius-radio

Type & motion

--cml-duration-fast--cml-ease-standard--cml-font-body

This component only

--cml-check-on-image--cml-corner-shape--cml-disabled-opacity--cml-radio-dot-shadow

Accessibility

TabMoves focus into the group, to the picked radio (or the first one), and out again.
Arrow keysMove to the previous or next radio and pick it.
SpacePicks the focused radio if it isn't picked yet.
Was this page helpful? · Edit this page on GitHub