Radio

Stable

Radio buttons for single selection from multiple options.

Import

import { Radio, RadioGroup } from '@brutal-ui/react';

Basic Usage

Selected: option1

const [value, setValue] = useState('option1');

<RadioGroup value={value} onValueChange={setValue}>
  <Radio value='option1' label='Option 1' />
  <Radio value='option2' label='Option 2' />
  <Radio value='option3' label='Option 3' />
</RadioGroup>

Disabled Options

Use Case: Payment Method

Props

RadioGroup
PropTypeDefaultDescription
valuestring-Selected value
onValueChangefunction-Value change handler
Radio
PropTypeDefaultDescription
valuestring-Radio button value
labelstring-Label text
disabledbooleanfalseDisable radio