Toggle button
ToggleButton
allows users to switch between two states, typically representing an on/off or active/inactive status. The corresponding action takes effect immediately. With ToggleButtonGroup
, users can make a mutually exclusive selection from a set of related commands—with only one option selected at a time.
Also known as: Button group, Toggle button group, Toggle group, Segmented control
Note: This tab list includes overflow; tab positions may be inaccurate or change when a tab is selected
- When a toggle button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a toggle button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
On focus, the screen reader should:
- Identify the toggle button.
- Read out the text.
- Expresses the state.
- Read the position of the option within the total number of buttons available.
Key | Function |
---|---|
Tab |
|
Space / Enter |
|
Shift + Tab |
|
Right arrow / Down arrow |
|
Left arrow / Up arrow |
|
- When a toggle button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a toggle button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
On focus, the screen reader should:
- Identify the toggle button.
- Read out the text.
- Expresses the state.
- Read the position of the option within the total number of buttons available.
Key | Function |
---|---|
Tab |
|
Space / Enter |
|
Shift + Tab |
|
Right arrow / Down arrow |
|
Left arrow / Up arrow |
|
- When a toggle button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a toggle button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
On focus, the screen reader should:
- Identify the toggle button.
- Read out the text.
- Expresses the state.
- Read the position of the option within the total number of buttons available.
Key | Function |
---|---|
Tab |
|
Space / Enter |
|
Shift + Tab |
|
Right arrow / Down arrow |
|
Left arrow / Up arrow |
|