Skip to content

SegmentedControl

Segmented toggle control for selecting one option from a small set. Rendered as a radio group (`role="radiogroup"`), so reach for it when picking a value — filters, settings, or view modes whose content you render yourself. If selecting an option should show or hide associated content panels, use Tabs instead.

<SegmentedControl label="Date range" layout="hug" size="md" value="day" />
<SizesStory {...args} />
<FillLayoutStory {...args} />
<SegmentedControl
label="Date range"
layout="hug"
size="md"
value="day"
isDisabled
/>
<DisabledItemStory {...args} />
<IconOnlyStory {...args} />
<IconWithLabelStory {...args} />
<ManyItemsStory {...args} />

Segmented toggle control for selecting one option from a small set. Rendered as a radio group (`role="radiogroup"`), so reach for it when picking a value — filters, settings, or view modes whose content you render yourself. If selecting an option should show or hide associated content panels, use Tabs instead.

PropTypeDefaultDescription
children*ReactNodeSegmentedControlItem children.
classNamestringAdditional CSS class names applied to the root element.
data-testidstringTest ID applied to the root element.
isDisabledbooleanfalseWhether the entire control is disabled.
label*stringAccessible label for the radio group.
layout"fill" | "hug"'hug'Segment layout mode.
onChange*(value: TValue) => voidCalled when a segment is selected.
refRef<HTMLDivElement>Ref forwarded to the root element.
size"sm" | "md" | "lg"'md'Control size.
styleCSSPropertiesInline styles applied to the root element.
value*TValueCurrent selected value.

Individual segment within a `SegmentedControl`.

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the segment.
data-testidstringTest ID applied to the segment.
iconIconComponentIcon element displayed before the label.
isDisabledbooleanfalseWhether this segment is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringAccessible and visible label for the segment.
refRef<HTMLButtonElement>Ref forwarded to the segment button.
styleCSSPropertiesInline styles applied to the segment.
value*TValueUnique value represented by this segment.