Segmented controls let users switch between related options.
defaultIndex prop.defaultIndex is 0 by default.selectedIndex and onChange props.SegmentedItem, set the disabled prop to true.sm, md, lg and responsive and can be changed by passing the size prop.lg.responsive, the component will be responsive to the viewport.Screen prefix | Screen width | Component size |
|---|---|---|
|
| sm |
|
| md |
|
| lg |
SegmentedItem component has the type="button", role="radio", tabIndex="-1" and data-segmented-item-index is current index of this item in a Segmented component.SegmentedItem has the aria-checked="true" and tabIndex="0"Segmented component supports the following keyboard interactions when focus is on the SegmentedItem component:Key | Description |
|---|---|
| - Moves focus to the next segmented item. |
| - Moves focus to the previous segmented item. |
| Moves focus to the first segmented item. |
| Moves focus to the last segmented item. |