Forms
IToggleGroup
A row of toggles sharing one model — a view switcher, a date range, a formatting toolbar. The group is one Tab stop, with the arrow keys moving between items.
Single or multiple
single is the default and behaves like a segmented control — one item on at a time, with the model holding that item's value. multiple lets any number be on, and the model becomes an array.
Active: Bold
Items
A bare string becomes both the label and the value. Pass objects when the two differ, or when an item needs an icon, an ariaLabel or disabling.
const items = [
'List', // label and value both "List"
{ label: 'Board', value: 'board' }, // value differs from the label
{ label: 'Calendar', icon: CalendarIcon }, // icon beside the label
{ label: 'Timeline', disabled: true }, // present but not selectable
]Variants
variant decides how the items are spaced. joined, the default, squares them where they meet and collapses their adjacent borders, as IButtonGroup does. plain leaves them as free-standing buttons with a gap.
Either way an item is the same button IToggle renders, so a group and a lone toggle sit together.
Icon-only
icon-only hides the labels and squares the items. Each label becomes its item's accessible name; pass ariaLabel on an item when the label is too terse to stand alone.
Sizes
The same five sizes as IToggle and IButton.
Full width
block stretches the group and splits the width evenly between its items.
Vertical
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | (string | ToggleGroupItemOption)[] | [] | |
type | 'single' | 'multiple' | 'single' | Decides whether the model is a value or an array |
modelValue | string | string[] | — | |
variant | 'joined' | 'plain' | 'joined' | Whether the items touch or stand apart |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | |
orientation | 'horizontal' | 'vertical' | 'horizontal' | Also decides which arrow keys move focus |
iconOnly | boolean | false | Hide labels, square the items, keep the names |
block | boolean | false | Stretch to fill, splitting the width |
disabled | boolean | false | Disables the whole group |
loop | boolean | false | Wrap from the last item back to the first |
unstyled | boolean | — | Skip built-in classes |
ui | { root?, item? } | — | Per-slot class overrides |
ToggleGroupItemOption
| Field | Type | Description |
|---|---|---|
label | string | |
value | string | Defaults to the label |
icon | IconLike | |
disabled | boolean | |
ariaLabel | string | Names the item when iconOnly hides its label |
Events
| Event | Payload |
|---|---|
update:modelValue | string | string[] |
Slots
| Slot | Props | Description |
|---|---|---|
item | { item } | Replaces an item's contents |
Accessibility
The group is one Tab stop; arrow keys move between items from there, along the axis orientation sets. Set loop to wrap around at the ends. With icon-only, each item's hidden label becomes its aria-label, so the group never reaches a screen reader as a row of unnamed buttons.