SegmentedControl
SegmentedControl is used to pick one choice from a linear set of closely related choices, and immediately apply that selection.
Page navigation navigation
Anatomy

Usage
For implicitly saved settings
Use SegmentedControls to pick and immediately apply an option, similar to radio inputs but without needing form submission.

For more information about explicit and automatic save patterns, see the saving pattern guidleines.
To toggle content visibility
The current implementations of our SegmentedControl do not support rendering segments as links (<a>
tags).
Continue to avoid using SegmentedControls that change the URL until we have a solution for rendering segments as links.
SegmentedControls may also be used to change how content in a view is rendered. The following use cases are an acceptable use for a SegmentedControl:
- Sort control: Sort items in a list.
- Filter control: Show/hide list items, and there should be a segment that shows the full list.
- Content formatting picker: Changes the formatting of the same content.



If selecting a segment changes the URL, the segments should be rendered as <a>
tags.
See the decision tree for choosing a pattern for tabbed interfaces for more detailed guidance and alternative patterns.
Content
Segments
A SegmentedControl should have 2–5 choices with text labels, or up to 6 icon-only segments. If more are needed, consider another choice selection component such as RadioGroup or ActionMenu.




Segment icons
Icons add visual cues. Be consistent (all icons, all text, or icons with text) and don’t change icons to indicate state.




Icon-only segments
Icons without text labels are fine if their meaning is obvious. Include a tooltip for clarity.


Segment label text
Label segments with nouns or short phrases; avoid multiline labels.


Contextual information
Label
SegmentedControls must have a text label, even if the label is only accessible to screen readers.
A visible label is the most direct way to identify what the control is used for, but the location and surrounding elements of the control often give enough context to visually hide the label.
Caption
An optional caption may be used to provide additional context to help users make a selection or explain what effect the selection will have. Caption text should be as short as possible.
See the layout section for ways to compose a SegmentedControl with a label.
Interaction
Selections are mutually exclusive and apply instantly, without needing a "Save" button. Once a selection has been made, it can only be deselected by making a new selection.
Layout
Composing the control with a label and caption
Single-column
A single-column layout is the same way form controls (for example, TextInputs) are layed out. The single-column layout is useful for preserving horizontal space.

Two-column
Aligns controls with adjacent elements and conserves vertical space while grouping related controls in a way that's easy to scan.
Responsive design
For narrow spaces, use icons only or replace the control with an ActionMenu.
Convert to an ActionMenu
Swapping out the SegmentedControl for an ActionMenu is especially helpful when:
- The icons cannot be understood without visible text labels
- The control is still too wide when text labels are hidden

Only show icons
If your SegmentedControl uses icons that can be understood without a visible text label, then you can hide the text labels and rely only on icons.


