Form
RadioButton
Native radios under drawn rings, grouped by RadioGroup with one name and one v-model.
WAI-ARIA tested
Import
main.ts
import { RadioButton } from '@vitral/vue';Radio group
Tab into the group, then use the arrow keys.
Delivery
Value: standard
Horizontal, with object values
Plan
Value: {
"id": "pro",
"name": "Pro",
"price": 12
}
Invalid and sizes
Size (required)
Without a group
Standalone radios share a group by their `name`.
API
Read from packages/vue/src/components/RadioButton/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| value | any | What v-model becomes when this radio is chosen; compared structurally, so objects work. |
| name | string | Radios that share a name are one group to the browser. A RadioGroup provides it. |
| label | string | The text beside the ring; the default slot takes richer content. Either becomes its `<label>`. |
| size | Size | — |
| invalid | boolean | — |
| disabled | boolean | — |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| change | event: RadioButtonChangeEvent | — |
| focus | event: FocusEvent | — |
| blur | event: FocusEvent | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | The label's content. |