Components

BaseToggleGroup

A segmented control for views, periods and short options, with icons and counters.

components/ui/inputs/BaseToggleGroup.vue
View in the demo

Example

Period
Alignment

Views with counters and custom items

compact fit is the views bar of every list (orders, customers, invoices…). countColor highlights an urgent count. The #item slot renders anything inside a segment.

API

Props

Name
Type
Default
Description
items
required
BaseToggleItem[]—The segments, each { title, value, icon?, count?, countColor?, disabled? }. With an icon, only the icon shows and the title becomes its tooltip.
mandatorybooleanfalsePrevents clearing the selection.
sizestring"small"The Vuetify button size.
compactbooleanfalseLower segments for toolbars.
fitbooleanfalseSizes the group to its content instead of the full width.
collapsebooleanfalseRenders a select with the same items (counts in brackets) instead of the segments below 600px and whenever the segments do not fit their container, so long view lists never clip or scroll. It switches back to segments when the container grows.
labelstring—The visible label above the field, linked to it with for and aria-labelledby.
input-idstring—A fixed id for the input. One is generated with useId() when you leave it out.
optionalboolean—Adds “(optional)” after the label. Never mark required fields.
infoBaseInputInfo—A help popover next to the label: a text or a list of { title, text }.
v-modelBaseSelectionValue | nullnullThe selected value.

Slots

Name
Slot props
Description
#item{ item: BaseToggleItem; active: boolean; }The content of a segment, with item and active.

Events

Name
Payload
Description
@update:modelValue[value: BaseSelectionValue | null]—

Accessibility

Each segment is a button with aria-pressed. Icon-only segments get their title as aria-label. Give the group a label or an aria-label.

© 2026 melsami UI.
Developer documentation for melsami UI.