Back to Components

Segmented Control

Overview

A segmented control is a group of two or more options which function as mutually exclusive buttons. Within the control, all segments are equal width.

Best Practices

Segmented controls should:

  • Have a limited number of options
  • Try to keep segment content size consistent
  • Avoid mixing text and icons inside a Segmented Control

Content guidelines

Follow the content guidelines outlined in the button component.

Examples

Segmented control

Used to present mutually exclusive options as buttons.

Code example
Playroom
Map View

Label Positioning

Positioning of the label for the segmented control can be varied. Using the option "hidden" will visually hide the label while still providing an accessible way for screen reader users to identify the related options.

Code example
Playroom

Left

Map View

Hidden

Map View

Disabled Option State

Used to indicate to the user that an action is not currently available. Disabled buttons do not respond to user input (and therefore will not trigger onClick behavior).

Code example
Playroom
Map View

Option with onClick handler

Used to trigger an onClick handler when an option is clicked. Does not conflict with onChange.

Code example
Playroom
Map View

Option with onKeyDown handlers

Used to trigger an onKeyDown handler with keyboard events. Does not conflict with onChange.

To navigate and select with the keyboard, tab into the component and use arrow keys and enter within the component, as outlined in accessibility guidelines.

Code example
Playroom
Map View
Selected: none