Toggle button
ToggleButton allows users to switch states, typically representing on/off or active/inactive status. The corresponding action takes effect immediately. With ToggleButtonGroup, users can make a single choice 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
| Salt package | @salt-ds/core |
|---|
- When a toggle button has both an icon and text, use
aria-hiddenon 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-labelto the button that describes its purpose.
| Key | Function |
|---|---|
| Tab |
|
| Space / Enter |
|
| Shift + Tab |
|
| Right arrow / Down arrow |
|
| Left arrow / Up arrow |
|