Skip to Content

Radio

A form component that restricts users to selecting exactly one option from an associated button set. 
For more information on this component configuration, visit Radix UI 

Disabled

Use the disabled attr or the disabled class to disable a component.

Controlled

Use the value and onValueChange props when you need to control the value externally.

Uncontrolled

Use the name prop to include the value in the form submission.


Sizes

Use the radio-group-{size} class to control the component size.

Size values can include:smmdlg.

For more information on all available sizing utilities, visit Tailwind 

Variants

Use the variant and palette classes to control the appereance of the component.

Variant values can include solidoutlinesurfacesubtle.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.

Customizing

globals.css
:root { --ex-radio-cursor: default; --ex-radio-gap-x-sm: calc(var(--spacing) * 2); --ex-radio-gap-x-md: calc(var(--spacing) * 2.5); --ex-radio-gap-x-lg: calc(var(--spacing) * 3); --ex-radio-radius-sm: 9999px; --ex-radio-radius-md: 9999px; --ex-radio-radius-lg: 9999px; --ex-radio-size-sm: calc(var(--spacing) * 4); --ex-radio-size-md: calc(var(--spacing) * 5); --ex-radio-size-lg: calc(var(--spacing) * 6); --ex-radio-indicator-font-size-sm: var(--text-xs); --ex-radio-indicator-font-size-md: var(--text-base); --ex-radio-indicator-font-size-lg: var(--text-lg); --ex-radio-label-font-family: var(--font-sans); --ex-radio-label-font-weight: var(--font-weight-medium); --ex-radio-label-font-size-sm: var(--text-xs); --ex-radio-label-font-size-md: var(--text-sm); --ex-radio-label-font-size-lg: var(--text-base); }

API

For more information on this component configuration, visit Radix UI 

Radio Group

ElementSelector
RadioGroup.ex-radio-group
PropTypeDefault
asElementTypediv
asChildbooleanfalse
defaultValuestring
disabledbooleanfalse
loopbooleantrue
namestring
requiredbooleanfalse
valuestring
onValueChangefunction

Radio

ElementSelector
Checkbox.ex-radio
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Radio Control

ElementSelector
Checkbox.ex-radio-control
PropTypeDefault
asElementTypebutton
asChildbooleanfalse
disabledbooleanfalse
requiredbooleanfalse
valuestring

Radio Indicator

ElementSelector
Checkbox.ex-radio-indicator
PropTypeDefault
asElementTypediv
asChildbooleanfalse
forceMountbooleanfalse

Radio Label

ElementSelector
Checkbox.ex-radio-label
PropTypeDefault
asElementTypelabel
asChildbooleanfalse
Last updated on