Radio
StableRadio 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 | |||
|---|---|---|---|
| Prop | Type | Default | Description |
| value | string | - | Selected value |
| onValueChange | function | - | Value change handler |
| Radio | |||
|---|---|---|---|
| Prop | Type | Default | Description |
| value | string | - | Radio button value |
| label | string | - | Label text |
| disabled | boolean | false | Disable radio |