📄 radixui/primitives/docs/components/radio-group

File: radio-group.md | Updated: 11/15/2025

Source: https://www.radix-ui.com/primitives/docs/components/radio-group

Radix Homepage

Made by WorkOS

Radix Homepage

Made by WorkOS

ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors

Documentation Case studies Blog

Search

/

Overview

Introduction Getting started Accessibility Releases

Guides

Styling Animation Composition Server-side rendering

Components

Accordion Alert Dialog Aspect Ratio Avatar Checkbox Collapsible Context Menu Dialog Dropdown Menu Form

Preview
Hover Card Label Menubar Navigation Menu One-Time Password Field

Preview
Password Toggle Field

Preview
Popover Progress Radio Group Scroll Area Select Separator Slider Switch Tabs Toast Toggle Toggle Group Toolbar Tooltip

Utilities

Accessible Icon Direction Provider Portal Slot Visually Hidden

Components

Radio Group

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

Default

Comfortable

Compact

index.jsxindex.jsxstyles.cssstyles.css

CSS

import * as React from "react";
import { RadioGroup } from "radix-ui";
import "./styles.css";

const RadioGroupDemo = () => (
	<form>
		<RadioGroup.Root
			className="RadioGroupRoot"
			defaultValue="default"
			aria-label="View density"
		>
			<div style={{ display: "flex", alignItems: "center" }}>
				<RadioGroup.Item className="RadioGroupItem" value="default" id="r1">
					<RadioGroup.Indicator className="RadioGroupIndicator" />
				</RadioGroup.Item>
				<label className="Label" htmlFor="r1">
					Default
				</label>
			</div>
			<div style={{ display: "flex", alignItems: "center" }}>
				<RadioGroup.Item className="RadioGroupItem" value="comfortable" id="r2">
					<RadioGroup.Indicator className="RadioGroupIndicator" />
				</RadioGroup.Item>
				<label className="Label" htmlFor="r2">
					Comfortable
				</label>
			</div>
			<div style={{ display: "flex", alignItems: "center" }}>
				<RadioGroup.Item className="RadioGroupItem" value="compact" id="r3">
					<RadioGroup.Indicator className="RadioGroupIndicator" />
				</RadioGroup.Item>
				<label className="Label" htmlFor="r3">
					Compact
				</label>
			</div>
		</RadioGroup.Root>
	</form>
);

export default RadioGroupDemo;

Features

Full keyboard navigation.

Supports horizontal/vertical orientation.

Can be controlled or uncontrolled.

Installation


Install the component from your command line.

npm install @radix-ui/react-radio-group

Anatomy


Import all parts and piece them together.

import { RadioGroup } from "radix-ui";

export default () => (
	<RadioGroup.Root>
		<RadioGroup.Item>
			<RadioGroup.Indicator />
		</RadioGroup.Item>
	</RadioGroup.Root>
);

API Reference


Root

Contains all the parts of a radio group.

| Prop | Type | Default | | --- | --- | --- | | asChild<br><br>Prop description | boolean | false | | defaultValue<br><br>Prop description | string | No default value | | value<br><br>Prop description | string | No default value | | onValueChange<br><br>Prop description | function<br><br>See full type | No default value | | disabled<br><br>Prop description | boolean | No default value | | name<br><br>Prop description | string | No default value | | required<br><br>Prop description | boolean | No default value | | orientation<br><br>Prop description | enum<br><br>See full type | undefined | | dir<br><br>Prop description | enum<br><br>See full type | No default value | | loop<br><br>Prop description | boolean | true |

| Data attribute | Values | | --- | --- | | [data-disabled] | Present when disabled |

Item

An item in the group that can be checked. An input will also render when used within a form to ensure events propagate correctly.

| Prop | Type | Default | | --- | --- | --- | | asChild<br><br>Prop description | boolean | false | | value<br><br>Prop description | string | No default value | | disabled<br><br>Prop description | boolean | No default value | | required<br><br>Prop description | boolean | No default value |

| Data attribute | Values | | --- | --- | | [data-state] | "checked" \| "unchecked" | | [data-disabled] | Present when disabled |

Indicator

Renders when the radio item is in a checked state. You can style this element directly, or you can use it as a wrapper to put an icon into, or both.

| Prop | Type | Default | | --- | --- | --- | | asChild<br><br>Prop description | boolean | false | | forceMount<br><br>Prop description | boolean | No default value |

| Data attribute | Values | | --- | --- | | [data-state] | "checked" \| "unchecked" | | [data-disabled] | Present when disabled |

Accessibility


Adheres to the Radio Group WAI-ARIA design pattern and uses roving tabindex to manage focus movement among radio items.

Keyboard Interactions

| Key | Description | | --- | --- | | Tab | Moves focus to either the checked radio item or the first radio item in the group. | | Space | When focus is on an unchecked radio item, checks it. | | ArrowDown | Moves focus and checks the next radio item in the group. | | ArrowRight | Moves focus and checks the next radio item in the group. | | ArrowUp | Moves focus to the previous radio item in the group. | | ArrowLeft | Moves focus to the previous radio item in the group. |

PreviousProgress

NextScroll Area

Edit this page on GitHub.