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

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

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

Radix Homepage

Made by WorkOS

Radix Homepage

Made by WorkOS

ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors

Documentation Playground Blog

Overview

Getting started Styling Layout Releases Resources

Theme

Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors

Layout

Box Flex Grid Container Section

Typography

Text Heading Blockquote Code Em Kbd Link Quote Strong

Components

Alert Dialog Aspect Ratio Avatar Badge Button Callout Card Checkbox Checkbox Group Checkbox Cards Context Menu Data List Dialog Dropdown Menu Hover Card Icon Button Inset Popover Progress Radio Radio Group Radio Cards Scroll Area Segmented Control Select Separator Skeleton Slider Spinner Switch Table Tabs Tab Nav Text Area Text Field Tooltip

Utilities

Accessible Icon Portal Reset Slot Theme Visually Hidden

Components

Radio Group

Set of interactive radio buttons where only one can be selected at a time.

View source Report an issue View in Playground

DefaultComfortableCompact

<RadioGroup.Root defaultValue="1" name="example">
	<RadioGroup.Item value="1">Default</RadioGroup.Item>
	<RadioGroup.Item value="2">Comfortable</RadioGroup.Item>
	<RadioGroup.Item value="3">Compact</RadioGroup.Item>
</RadioGroup.Root>

API Reference


This component inherits props from the Radio Group primitive and supports common margin props .

Root

Contains all the parts of a radio group.

| Prop | Type | Default | | --- | --- | --- | | asChild<br><br>Prop description | boolean | No default value | | size | Responsive<"1" \| "2" \| "3"> | "2" | | variant<br><br>Prop description | "classic" \| "surface" \| "soft" | "surface" | | color<br><br>Prop description | enum<br><br>See full type | No default value | | highContrast<br><br>Prop description | boolean | No default value |

Item

An item in the group that can be checked.

Examples


Size

Use the size prop to control the radiobutton size.

<Flex align="center" gap="2">
	<RadioGroup.Root size="1" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root size="2" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root size="3" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>
</Flex>

Variant

Use the variant prop to control the visual style of the radio buttons.

<Flex gap="2">
	<Flex direction="column" asChild gap="2">
		<RadioGroup.Root variant="surface" defaultValue="1">
			<RadioGroup.Item value="1" />
			<RadioGroup.Item value="2" />
		</RadioGroup.Root>
	</Flex>

	<Flex direction="column" asChild gap="2">
		<RadioGroup.Root variant="classic" defaultValue="1">
			<RadioGroup.Item value="1" />
			<RadioGroup.Item value="2" />
		</RadioGroup.Root>
	</Flex>

	<Flex direction="column" asChild gap="2">
		<RadioGroup.Root variant="soft" defaultValue="1">
			<RadioGroup.Item value="1" />
			<RadioGroup.Item value="2" />
		</RadioGroup.Root>
	</Flex>
</Flex>

Color

Use the color prop to assign a specific color .

<Flex gap="2">
	<RadioGroup.Root color="indigo" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="cyan" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="orange" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="crimson" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>
</Flex>

High-contrast

Use the highContrast prop to increase color contrast with the background.

<Grid rows="2" gap="2" display="inline-grid" flow="column">
	<RadioGroup.Root color="indigo" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="indigo" defaultValue="1" highContrast>
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="cyan" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="cyan" defaultValue="1" highContrast>
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="orange" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="orange" defaultValue="1" highContrast>
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="crimson" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="crimson" defaultValue="1" highContrast>
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="gray" defaultValue="1">
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>

	<RadioGroup.Root color="gray" defaultValue="1" highContrast>
		<RadioGroup.Item value="1" />
	</RadioGroup.Root>
</Grid>

Alignment

Composing RadioGroup.Item within Text automatically centers it with the first line of text.

Default

Compact

Default

Compact

Default

Compact

<Flex direction="column" gap="3">
	<RadioGroup.Root size="1" defaultValue="1">
		<Text as="label" size="2">
			<Flex gap="2">
				<RadioGroup.Item value="1" /> Default
			</Flex>
		</Text>

		<Text as="label" size="2">
			<Flex gap="2">
				<RadioGroup.Item value="2" /> Compact
			</Flex>
		</Text>
	</RadioGroup.Root>

	<RadioGroup.Root size="2" defaultValue="1">
		<Text as="label" size="3">
			<Flex gap="2">
				<RadioGroup.Item value="1" /> Default
			</Flex>
		</Text>

		<Text as="label" size="3">
			<Flex gap="2">
				<RadioGroup.Item value="2" /> Compact
			</Flex>
		</Text>
	</RadioGroup.Root>

	<RadioGroup.Root size="3" defaultValue="1">
		<Text as="label" size="4">
			<Flex gap="2">
				<RadioGroup.Item value="1" /> Default
			</Flex>
		</Text>

		<Text as="label" size="4">
			<Flex gap="2">
				<RadioGroup.Item value="2" /> Compact
			</Flex>
		</Text>
	</RadioGroup.Root>
</Flex>

It is automatically well-aligned with multi-line text too.

Disabled

Use the native disabled attribute to create a disabled radiobutton.

OffOn

OffOn

<Flex direction="column" gap="2">
	<RadioGroup.Root defaultValue="2">
		<RadioGroup.Item value="1">Off</RadioGroup.Item>
		<RadioGroup.Item value="2">On</RadioGroup.Item>
	</RadioGroup.Root>

	<RadioGroup.Root defaultValue="2">
		<RadioGroup.Item value="1" disabled>
			Off
		</RadioGroup.Item>
		<RadioGroup.Item value="2" disabled>
			On
		</RadioGroup.Item>
	</RadioGroup.Root>
</Flex>

PreviousRadio

NextRadio Cards

Edit this page on GitHub.