Radio Group
A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
Examples
Basic
Prop | Default | Type | Description |
---|---|---|---|
defaultValue | - | string | The value of the radio item that should be checked when initially rendered. |
disabled | false | boolean | When true, prevents the user from interacting with radio items. |
modelValue | - | string | The controlled value of the radio item to check. Can be binded as v-model . |
orientation | - | vertical , horizontal | The orientation of the component. |
items | - | RadioGroupItem[] | The radio items to render. |
RadioGroupItem Prop | Default | Type | Description |
---|---|---|---|
value | - | string | The value of the radio item. |
disabled | false | boolean | When true, prevents the user from interacting with the radio item. |
label | - | string | The label of the radio item. |
icon | - | string | The icon of the radio item. |
Read more in Radix Radio Group Root API.
Color
Prop | Default | Type | Description |
---|---|---|---|
radio-group | primary | {color} | Set the color of the radio-group. |
item.radioGroup | - | {color} | Set the color of the specific radio item. |
Size and Square
Prop | Default | Type | Description |
---|---|---|---|
size | md | string | Sets the size of the radio-group. |
square | 2.5rem | string | Sets the radio-group to a square shape with specified dimensions. This does not affect the size of the fallback value. |
item.size | md | string | Sets the size of the specific radio item. |
item.square | 2.5rem | string | Sets the specific radio item to a square shape with specified dimensions. This does not affect the size of the fallback value. |
🚀 Adjust radio-group size freely using any size, breakpoints (e.g.,
sm:sm, xs:lg
), or states (e.g.,hover:lg, focus:3xl
).
Icon
Prop | Default | Type | Description |
---|---|---|---|
icon | - | string | The icon to render. |
item.icon | - | string | The icon to render for the specific item. |
Read more in Icon component
Rounded
Prop | Default | Type | Description |
---|---|---|---|
rounded | md | string | Set the radio-group to be rounded. |
item.rounded | md | string | Set the specific radio item to be rounded. |
🚀 Adjust radio-group rounded freely using any value, breakpoints (e.g.,
sm:sm, xs:lg
), or states (e.g.,hover:lg, focus:full
).
Slots
Name | Props | Description |
---|---|---|
default | items | The item slot. |
label | - | The label slot. |
icon | - | The icon slot. |
You can use the RadioGroupItem
component to render the radio items.
Presets
shortcuts/radio-group.ts
Props
types/radio-group.ts