A SegmentedControl
should not be used in a form as a replacement for something like a RadioGroup or Select. See the Accessibility section of the SegmentedControl interface guidelines for more details.
Name | Type | 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) => void | The handler that gets called when a segment is selected | |
variant | | 'default' | { narrow?: 'hideLabels' | 'dropdown' | 'default' regular?: 'hideLabels' | 'dropdown' | 'default' wide?: 'hideLabels' | 'dropdown' | 'default' } | 'default' | Configure alternative ways to render the control when it gets rendered in tight spaces |
sx | SystemStyleObject | ||
ref | React.RefObject<HTMLDivElement> | A ref to the element rendered by this component. |
Name | Type | Default | Description |
---|---|---|---|
leadingIcon | Component | The leading icon comes before item label | |
selected | boolean | Whether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl. | |
defaultSelected | boolean | Whether the segment is selected. This is used for uncontrolled SegmentedControls to pick one SegmentedControlButton that is selected on the initial render. | |
sx | SystemStyleObject | ||
ref | React.RefObject<HTMLButtonElement> | A ref to the element rendered by this component. |
Name | Type | Default | Description |
---|---|---|---|
aria-label Required | string | ||
icon Required | Component | The icon that represents the segmented control item | |
selected | boolean | Whether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl. | |
selected | 'small' | 'medium' | The size of the buttons | |
defaultSelected | boolean | Whether the segment is selected. This is used for uncontrolled SegmentedControls to pick one SegmentedControlButton that is selected on the initial render. | |
sx | SystemStyleObject | ||
ref | React.RefObject<HTMLButtonElement> | A ref to the element rendered by this component. |