Skip to main content

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
  • To make a single selection when switching between views or states of information.
  • To visually prioritize options higher than RadioButton or Switch.
  • To present an instantaneous change of state between two options. Instead, use Switch.
  • When the options in the group are not high priority and high affordance is not necessary. Instead, use RadioButtonGroup.
  • When all options in the group don’t need to be visible at once. Consider using Dropdown.
  • When toggle behavior is needed to collect feedback or make a decision, such as Like/Dislike, rather than to change a view or state. Consider using Decision button group, which also lets users deselect their choice.
  • Never use ampersand (&) in button text to save space.
  • Keep the text description short, ideally one to three words and no more than five. If you’re including an icon with the text, use no more than three words.

To import ToggleButton and ToggleButtonGroup from the core Salt package, use:

import { ToggleButton, ToggleButtonGroup } from "@salt-ds/core";