Prepared Docs

Prepared Docs

⌘K

    Loading navigation…

User

  1. Components
  2. Segmented Control
  3. API and Development

Segmented Control

API and Development

View Source
Submit Issue

SegmentedControl displays a set of mutually exclusive options in a connected horizontal group, allowing users to switch between related views or settings with a single selection. It provides a compact selection interface where related options are presented as connected segments. Built on Radix UI's SegmentedControl component, it ensures consistent segmented control patterns across the interface with full keyboard and screen reader accessibility. Ideal for toggling between views, filters, or related options.

Props

SegmentedControl (Root)

NameDefaultDescription
childrenrequiredSegmentedControlItem components to display.
valueCurrently selected value (controlled component).
defaultValueDefault selected value (uncontrolled component).
onValueChangeCallback function called when selection changes: (value: string) => void.
disabledfalseWhether the segmented control is disabled.
sizeSegmentedControlSize.LargeControls the segment height and padding.
fullSpanfalseExpands segments evenly across the parent width. Without it, the control keeps its intrinsic width in flex layouts.
collapseUnselectedLabelsfalseAnimates unselected items down to their icons (200ms ease-out). The selection indicator follows measured item layout (no independent slide). Every collapsible item must provide icon and aria-label.

SegmentedControlItem

NameDefaultDescription
childrenrequiredContent to display in the segment (text, icons, etc.).
valuerequiredThe value of the segment.
disabledfalseWhether the individual segment is disabled.
iconLeading SVGAsset; required for items that collapse under collapseUnselectedLabels.
iconOnlyfalseRenders a compact square segment for icon-only content.
counterDisplays a subtle count beside the item label when greater than zero.

Basic SegmentedControl

Use for simple selection between related options.

Controlled SegmentedControl

Control selection state programmatically.

Tab Navigation

Use segmented controls for switching between views or tabs.

View Toggle

Toggle between different display modes or filters.

Display Mode Toggle

Switch between different data display formats.

Short Labels

Use concise labels for compact displays.

Long Labels

Segmented controls adapt to longer label text.

Mixed Label Lengths

Segments automatically adjust to accommodate different label lengths.

With Icons

Use icons to enhance visual communication.

Icon with Text

Combine icons and text for richer labels.

Disabled SegmentedControl

Disable the entire control when appropriate.

Disabled Segment

Disable individual segments while keeping others active.

Two Options

Use for simple binary choices.

Multiple Options

Support three or more options when grouping related choices.

Previous

Segmented Control / Usage

Next

Segmented Control / Accessibility

On this page

Props
SegmentedControl (Root)
SegmentedControlItem
Basic SegmentedControl
Controlled SegmentedControl
Tab Navigation
View Toggle
Display Mode Toggle
Short Labels
Long Labels
Mixed Label Lengths
With Icons
Icon with Text
Disabled SegmentedControl
Disabled Segment
Two Options
Multiple Options