SegmentedControl
SegmentedControl is used to pick one choice from a linear set of closely related choices, and immediately apply that selection.
Page navigation navigation
React examples
Default
Controlled
With leading icons
Guidelines for icons in segments
Icon-only
More examples
The previous examples are a curated subset of the full capabilities (such as reponsive behavior) of the SegmentedControl component. For more examples, see the SegmentedControl Storybook stories.
Props
SegmentedControl
| Name | Default | Description | 
|---|---|---|
aria-label   | string | |
aria-labelledby   | string | |
aria-describedby   | string | |
fullWidth   | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the control fills the width of its parent  | |
onChange   | (selectedIndex?: number) => voidThe handler that gets called when a segment is selected  | |
variant   | 'default' | | 'default' | { narrow?: 'hideLabels' | 'dropdown' | 'default' regular?: 'hideLabels' | 'dropdown' | 'default' wide?: 'hideLabels' | 'dropdown' | 'default' }Configure alternative ways to render the control when it gets rendered in tight spaces  | 
size   | 'small' | 'medium'The size of the buttons  | |
sx Deprecated  | SystemStyleObject | |
ref   | React.RefObject<HTMLDivElement> | 
SegmentedControl.Button
| Name | Default | Description | 
|---|---|---|
leadingIcon   | ComponentThe leading icon comes before item label  | |
selected   | booleanWhether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl.  | |
defaultSelected   | booleanWhether the segment is selected. This is used for uncontrolled SegmentedControls to pick one SegmentedControlButton that is selected on the initial render.  | |
sx Deprecated  | SystemStyleObject | |
ref   | React.RefObject<HTMLButtonElement> | 
SegmentedControl.IconButton
| Name | Default | Description | 
|---|---|---|
aria-label Required  | string | |
icon Required  | ComponentThe icon that represents the segmented control item  | |
selected   | booleanWhether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl.  | |
size   | 'small' | 'medium'The size of the buttons  | |
defaultSelected   | booleanWhether the segment is selected. This is used for uncontrolled SegmentedControls to pick one SegmentedControlButton that is selected on the initial render.  | |
sx Deprecated  | SystemStyleObject | |
ref   | React.RefObject<HTMLButtonElement> | |
tooltipDirection   | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | |
description   | stringIf   |