Segmented Control

New

Single-select, all-options-visible control for switching views, scopes, or modes within the same context.

Preview

Usage

A segmented control is a mutually exclusive, single-select control where all options are visible at once. Only one item can be selected at a time, and there is always one item selected. It is commonly used to switch between different views or formats of the same content — such as toggling between grid and list view, or filtering between "All", "Favorites", and "Recent".

Each dt-segmented-control-item wraps a DtButton internally and inherits its slot and prop surface, including #startIcon, #endIcon, #leading, #trailing, disabled, and label-class.

Segmented Control vs. Tabs

Segmented Control Tabs
Purpose Switch between views or formats of the same content Navigate between distinct content sections
Content relationship Same data, different presentation (e.g., grid vs. list) Different data in each section (the filing cabinet metaphor — each tab holds different papers)
Hierarchy Lower-level, often within a tabbed section Top-level content organization
ARIA role radiogroup with radio items tablist with tab items and associated tabpanels
Content panel None — consumers manage their own view switching Built-in panel association via aria-controls

Guidelines

Do

  • Use when presenting 2–5 mutually exclusive options that control the same content area.
  • Use concise labels — 1–3 words that describe the view the user will see.
  • Keep label lengths consistent across items for visual balance.
  • Use for switching between views or formats: grid/list, all/filtered, map/satellite.
  • Provide an aria-label on the segmented control that describes the purpose of the group.
  • Use the label prop on icon-only items for accessibility.

Don’t

  • Don't use for navigation between distinct content sections — use Tabs instead.
  • Don't use for binary on/off choices — use a Toggle instead.
  • Don't use for more than 5 options — consider a Select Menu or Chip group.
  • Don't mix text-only and icon-only items within the same control.
  • Don't use to trigger actions — use a Button or Button Group instead.

Variants

Default

Borderless

Remove the border and padding from the container.

Hide Divider

Spread Evenly

Items share space equally. Only applies in horizontal orientation.

Disabled

Add disabled to the group to disable all items.

Add disabled to an individual item.

Sizes

Slots

Icon

Use the #startIcon or #endIcon slot on dt-segmented-control-item to add an icon. The slot provides iconSize to match the control's size.

Icon Only

Omit the default slot text to create icon-only items. Use the label prop for accessibility.

Leading & Trailing

Use the #leading and #trailing slots on dt-segmented-control-item to render content alongside labels, such as badges or count indicators.

Orientation

Set orientation="vertical" to stack items vertically.

Advanced Usages

Manual Activation Mode

By default, items select immediately on focus via arrow keys, following the WAI-ARIA Radio Group pattern. Set activation-mode="manual" to require an explicit Enter or Space keypress after focusing an item.

Vue API

Segmented Control

import { DtSegmentedControl, DtSegmentedControlItem } from '@dialpad/dialtone-vue';

Slots

Name
Type
default

DtSegmentedControlItem children

Props

Name
Default
Type
modelValue required
string

The currently selected value (v-model).

activationMode
SEGMENTED_CONTROL_ACTIVATION_MODE_DEFAULT
"auto" | "manual"

Controls whether items are selected on focus (auto) or on click/Space/Enter (manual).

ariaLabel
string

Accessible label for the radiogroup.

borderless
false
boolean

Removes the border and padding from the container.

disabled
false
boolean

Disables all items in the group. Per-item disabled is set via the disabled prop on DtSegmentedControlItem.

id
generated unique ID
string

Element ID for the radiogroup container. Auto-generated if not provided.

labelClass
''
string|array|object

Default label class for all items. Items can override with their own labelClass prop.

orientation
SEGMENTED_CONTROL_ORIENTATION_DEFAULT
"horizontal" | "vertical"

Orientation of the segmented control. Maps to DtStack direction: horizontal -> row, vertical -> column.

showDivider
true
boolean

Shows the dividers between items.

showIndicatorTransition
true
"true" | "false"

If true, the selection indicator animates between items on click.

size
SEGMENTED_CONTROL_SIZE_DEFAULT
"100" | "200" | "300" | "400" | "500"

DtButton size for all items. Inherited by children via provide.

spread
SEGMENTED_CONTROL_SPREAD_DEFAULT
"grow" | "evenly"

Controls how items distribute space. 'grow' (default): items size to their content. 'evenly': items share space equally.

Events

Name
Type
before-change
Event

Emitted before a selection change. Call event.preventDefault() to cancel the change.

change
String

Emitted when the user selects an item (click, Enter, Space, or arrow in auto mode). Not emitted for programmatic modelValue changes.

update:modelValue
String

v-model event. Emitted when the selected value changes.

Segmented Control Item

Slots

Name
Type
default

Label text content

endIcon

Icon displayed at the inline-end of the label. Provides { iconSize } scoped binding.

leading

Content rendered before the label (e.g. badges, indicators).

startIcon

Icon displayed at the inline-start of the label. Provides { iconSize } scoped binding.

trailing

Content rendered after the label (e.g. badges, counts).

Props

Name
Default
Type
value required
string

Unique value for this item, used for selection matching with v-model.

disabled
false
boolean

Disables this individual item.

label
string

Accessible label for the button (aria-label). Visible text comes from the default slot, not this prop. Required for icon-only items.

labelClass
string|array|object

Custom class for this item's label container. Overrides the parent's labelClass when provided.

Events

Name
Type
click
PointerEvent | KeyboardEvent

Native button click event.

focus
FocusEvent

Native button focus event.

Classes

Class
Applies to
Description

Accessibility

The segmented control implements the WAI-ARIA Radio Group pattern with roving tabindex for keyboard navigation.

Item
Applies to
Description

Segmented Control documentation last updated Thursday, June 18, 2026