Radio
Radio button component for selecting one option from a group. Supports both compound pattern with Radio.Item and standalone usage.
Import
import { Radio, Col, Card, Heading, Row, Text } from '@sigx/daisyui';
Basic Usage (Compound Pattern)
Use Radio with Radio.Item children for grouped radio buttons:
Loading preview...
Sizes
Loading preview...
Colors
Loading preview...
Horizontal Direction
Loading preview...
Standalone Radio
For cases where you need more control, use Radio.Standalone:
Loading preview...
With Disabled Options
Loading preview...
Survey Example
Loading preview...
Props
Radio (RadioGroup) Props
| Prop | Type | Default | Description |
|---|---|---|---|
model | () => signal.property | - | Model binding for selected value |
name | string | required | HTML name attribute for the radio group |
size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | Size of all radio buttons |
color | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | - | Color of all radio buttons |
direction | 'horizontal' | 'vertical' | 'vertical' | Layout direction |
disabled | boolean | false | Disable all radio buttons |
class | string | - | Additional CSS classes |
Radio.Item Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | required | Value when this option is selected |
label | string | - | Label text |
disabled | boolean | false | Disable this specific option |
class | string | - | Additional CSS classes |
Radio.Standalone Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | required | HTML name attribute |
value | string | required | Value of this radio button |
checked | boolean | false | Whether this radio is selected |
label | string | - | Label text |
size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | Size |
color | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | - | Color |
disabled | boolean | false | Disable the radio |
class | string | - | Additional CSS classes |
Events
| Event | Type | Description |
|---|---|---|
onChange | (value: string) => void | Fired when selection changes |