File: radio.md | Updated: 11/15/2025
ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors
Getting started Styling Layout Releases Resources
Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors
Box Flex Grid Container Section
Text Heading Blockquote Code Em Kbd Link Quote Strong
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
Accessible Icon Portal Reset Slot Theme Visually Hidden
Components
Standalone radio button that can be used in any layout.
View source Report an issue View in Playground
DefaultComfortableCompact
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio name="example" value="1" defaultChecked />
Default
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio name="example" value="2" />
Comfortable
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio name="example" value="3" />
Compact
</Text>
</Flex>
</Flex>
This component inherits props from the Radio Group primitive and supports common margin props .
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 |
An item in the group that can be checked.
Use the size prop to control the radio button size.
<Flex align="center" gap="4">
<Flex gap="2">
<Radio size="1" name="size-1" value="1" defaultChecked />
<Radio size="1" name="size-1" value="2" />
</Flex>
<Flex gap="2">
<Radio size="2" name="size-2" value="1" defaultChecked />
<Radio size="2" name="size-2" value="2" />
</Flex>
<Flex gap="2">
<Radio size="3" name="size-3" value="1" defaultChecked />
<Radio size="3" name="size-3" value="2" />
</Flex>
</Flex>
Use the variant prop to control the visual style of the radio buttons.
<Flex align="center" gap="4">
<Flex gap="2">
<Radio variant="surface" name="surface" value="1" defaultChecked />
<Radio variant="surface" name="surface" value="2" />
</Flex>
<Flex gap="2">
<Radio variant="classic" name="classic" value="1" defaultChecked />
<Radio variant="classic" name="classic" value="2" />
</Flex>
<Flex gap="2">
<Radio variant="soft" name="soft" value="1" defaultChecked />
<Radio variant="soft" name="soft" value="2" />
</Flex>
</Flex>
Use the color prop to assign a specific color
.
<Flex as="span" gap="2">
<Radio color="indigo" defaultChecked />
<Radio color="cyan" defaultChecked />
<Radio color="orange" defaultChecked />
<Radio color="crimson" defaultChecked />
</Flex>
Use the highContrast prop to increase color contrast with the background.
<Grid columns="5" display="inline-grid" gap="2">
<Radio color="indigo" defaultChecked />
<Radio color="cyan" defaultChecked />
<Radio color="orange" defaultChecked />
<Radio color="crimson" defaultChecked />
<Radio color="gray" defaultChecked />
<Radio color="indigo" defaultChecked highContrast />
<Radio color="cyan" defaultChecked highContrast />
<Radio color="orange" defaultChecked highContrast />
<Radio color="crimson" defaultChecked highContrast />
<Radio color="gray" defaultChecked highContrast />
</Grid>
Composing Radio within Text automatically centers it with the first line of text. It is automatically well-aligned with multi-line text too.
DefaultCompact
DefaultCompact
DefaultCompact
<Flex direction="column" gap="3">
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio size="1" name="alignment-1" value="1" defaultChecked />
Default
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio size="1" name="alignment-1" value="2" />
Compact
</Text>
</Flex>
</Flex>
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="3">
<Radio size="2" name="alignment-2" value="1" defaultChecked />
Default
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="3">
<Radio size="2" name="alignment-2" value="2" />
Compact
</Text>
</Flex>
</Flex>
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="4">
<Radio size="3" name="alignment-3" value="1" defaultChecked />
Default
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="4">
<Radio size="3" name="alignment-3" value="2" />
Compact
</Text>
</Flex>
</Flex>
</Flex>
Use the native disabled attribute to create a disabled radio button.
OnOff
OnOff
<Flex direction="column" gap="3">
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio name="enabled" value="1" defaultChecked />
On
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="2">
<Radio name="enabled" value="2" />
Off
</Text>
</Flex>
</Flex>
<Flex align="start" direction="column" gap="1">
<Flex asChild gap="2">
<Text as="label" size="2" color="gray">
<Radio disabled name="disabled" value="1" defaultChecked />
On
</Text>
</Flex>
<Flex asChild gap="2">
<Text as="label" size="2" color="gray">
<Radio disabled name="disabled" value="2" />
Off
</Text>
</Flex>
</Flex>
</Flex>
PreviousProgress
NextRadio Group