A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
Full keyboard navigation.
Supports horizontal/vertical orientation.
Can be controlled or uncontrolled.
Install the component from your command line.
npm install @radix-ui/react-radio-group
Import all parts and piece them together.
import * as RadioGroup from '@radix-ui/react-radio-group';
export default () => (
<RadioGroup.Root>
<RadioGroup.Item>
<RadioGroup.Indicator />
</RadioGroup.Item>
</RadioGroup.Root>
);
Contains all the parts of a radio group.
An item in the group that can be checked. An input
will also render when used within a form
to ensure events propagate correctly.
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.
Adheres to the Radio Group WAI-ARIA design pattern and uses roving tabindex to manage focus movement among radio items.