Skip to main content

Radio

Radio is a radio button component with size variants, custom styling, and optional inline labels. Use the name prop to group radios together.

Open in Storybook

Import

import { Radio } from "@tosui/react";

Basic Usage

Without Label

Sizes

States

Controlled

Use isChecked and onChange for controlled mode.

function ControlledRadioGroup() {
const [selected, setSelected] = useState("option1");

return (
<VStack gap={2} align="flex-start">
<Radio
name="controlled"
label="Option 1"
value="option1"
isChecked={selected === "option1"}
onChange={() => setSelected("option1")}
/>
<Radio
name="controlled"
label="Option 2"
value="option2"
isChecked={selected === "option2"}
onChange={() => setSelected("option2")}
/>
<Radio
name="controlled"
label="Option 3"
value="option3"
isChecked={selected === "option3"}
onChange={() => setSelected("option3")}
/>
</VStack>
);
}

Radio Group with Label

Select your plan:

Props Reference

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Radio size
labelstring-Optional label text
namestring-Group name (required to link radios)
valuestring-Radio value
disabledbooleanfalseDisable the radio
isCheckedboolean-Controlled checked state
defaultCheckedboolean-Initial checked state (uncontrolled)
onChange(e: ChangeEvent) => void-Change handler

Radio also accepts all native <input type="radio"> attributes.

Accessibility

  • Uses native <input type="radio"> for accessibility
  • Label is associated with the input
  • Use the same name prop to group radios
  • Supports keyboard navigation (arrow keys to switch between options)
  • When no label is provided, use aria-label for accessibility

TypeScript

import { Radio, type RadioSize, type RadioProps } from "@tosui/react";