Forms | OptionGroup
OptionGroup#
Description#
Group of mutually exclusive options with keyboard navigation (arrows and Tab), list or card variant, optional badge and avatar support.
Props#
options(OptionGroupOption[]) — Group options. Required. label(string) — Accessible name of the group. Required.model(T | null) — Selected value (v-model). Default:null.variant('list' | 'card') — Visual style. Default:'list'.size('sm' | 'md') — Row size. Default:'md'.disabled(boolean) — Disables the entire group. Default:false.
Emits#
change(value: T) — Emitted when an option is selected.
Slots#
option(props: { option: OptionGroupOption; checked: boolean }) — Customizes the content of each option. trailing(props: { option: OptionGroupOption; checked: boolean }) — Content at the end of each option (before the dot in cardvariant).
Usage#
| |
Notes#
- Keyboard navigation uses a roving tabindex pattern: Tab enters the group, arrows change the selection.
optionsis generic (T extends string | number), allowing numeric or string values.- In
variant="card", the icon is shown in a bordered box that changes style based on selection. - The indicator dot is positioned on the left in
listand on the right incard. disableddisables all options; each option can also be disabled individually.