1. Documentation
  2. Forms
  3. Radio
ReadmenpmGitHub
  • Introduction
  • Installation
  • Theming
  • Icons
  • Accordion
  • Card
  • Scroll Area
  • Separator
  • Sidebar
  • Field
  • Label
  • Input
  • Textarea
  • Number Field
  • OTP Field
  • Select
  • Combobox
  • Checkbox
  • Radio
  • Switch
  • Slider
  • Toggle
  • Calendar
  • Date Picker
  • File Upload
  • Button
  • Copy Button
  • Dropdown
  • Command
  • Tabs
  • Breadcrumb
  • Pagination
  • Tree
  • Table
  • Data Table
  • Stat
  • Timeline
  • Avatar
  • Status Bar
  • Badge
  • Meter
  • Empty
  • Skeleton
  • Spinner
  • Toast
  • Dialog
  • Sheet
  • Popover
  • Tooltip
  • Text
  • Kbd
  • Code Block
  • Utilities
  • Design rules

Radio

One choice from a short, visible list — vertical by default, horizontal when the options are two words long.

Loading documentation…

Checkbox< PreviousSwitchNext >

Powered by heyo

On this page

UsageHorizontalIn a fieldPropertiesRadioGroupRadio
<RadioGroup defaultValue="prod"><Radio value="prod" label="Production" description="Serves live traffic." /><Radio value="preview" label="Preview" description="One per pull request." /><Radio value="dev" label="Development" description="Local only." /></RadioGroup>

Radio is for a choice the reader should see all of. Three or four options with a sentence of explanation each is exactly its job — beyond that, use a Select and give the list back its scroll.

Like Checkbox, passing label renders the whole clickable row; without it you get the dot alone.

Usage

tsx
import { Radio, RadioGroup } from "@heyo-sh/heyo-ui";<RadioGroup defaultValue="prod" onValueChange={setEnvironment}>  <Radio value="prod" label="Production" />  <Radio value="preview" label="Preview" /></RadioGroup>;

Horizontal

Switch the axis when the labels are short enough to scan in a row — a unit, a density, a yes/no.

<RadioGroup orientation="horizontal" defaultValue="monthly"><Radio value="monthly" label="Monthly" /><Radio value="yearly" label="Yearly" /></RadioGroup>

In a field

A radio group has no single control to label, so the group heading comes from Field.

Change it at any time.

<Field label="Billing period" description="Change it at any time."><RadioGroup defaultValue="yearly">  <Radio value="monthly" label="Monthly" />  <Radio value="yearly" label="Yearly" description="Two months free." /></RadioGroup></Field>

Properties

RadioGroup

value / defaultValuestringoptional

Controlled and uncontrolled selection.

onValueChange(value: string) => voidoptional

Fires when the selection changes.

orientation"vertical" | "horizontal"optional

The layout axis. It defaults to vertical.

disabled / required / name—optional

Standard form behaviour, passed through to Base UI.

Radio

valuestringrequired

The value this option contributes to the group.

labelReactNodeoptional

An inline label. Its presence turns the component into the whole clickable row.

descriptionReactNodeoptional

Muted helper text under the label.

disabledbooleanoptional

Dims this option and ignores interaction.

wrapperClassNamestringoptional

Class for the outer <label>.

classNamestringoptional

Class for the dot itself.