Multiple groups
Each group must have a unique name to function independently.
vue
<template>
<NbRadio
v-model="plan"
name="plan"
label="Billing plan"
:options="planOptions"
/>
<NbRadio
v-model="cycle"
name="cycle"
label="Billing cycle"
:options="cycleOptions"
/>
</template>Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | undefined | The selected option value (v-model) |
name | string | required | name attribute shared by the group |
options | Option[] | [] | Array of radio button options |
label | string | undefined | Optional group label |
Option interface
typescript
interface Option {
label: string // Display text
value: string // Option value
}Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Emitted when the selection changes |
Accessibility
- Radio buttons are grouped by a shared
nameattribute. - Keyboard navigation:
Arrowkeys to move between options,Spaceto select. - Provide a
labelwhenever the group purpose isn't obvious from surrounding context.