Radio Group
A set of checkable buttons where only one can be checked at a time.
Preview
Option 1
Option 2
Option 3
Usage
<ui-radio-group defaultValue="option-1">
<div class="flex items-center space-x-2">
<ui-radio-group-item value="option-1" id="option-1"></ui-radio-group-item>
<ui-label for="option-1">Option 1</ui-label>
</div>
<div class="flex items-center space-x-2">
<ui-radio-group-item value="option-2" id="option-2"></ui-radio-group-item>
<ui-label for="option-2">Option 2</ui-label>
</div>
<div class="flex items-center space-x-2">
<ui-radio-group-item value="option-3" id="option-3"></ui-radio-group-item>
<ui-label for="option-3">Option 3</ui-label>
</div>
</ui-radio-group>
Sub-components
<ui-radio-group> <ui-radio-group-item>
Props
<ui-radio-group>
| Prop | Type | Default | Description |
|---|
defaultValue | string | — | The default selected value. |
value | string | — | Controlled selected value. |
<ui-radio-group-item>
| Prop | Type | Default | Description |
|---|
value | string | — | The value of this radio item. |
All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.