React · SwiftUI · agent guides
Toggle
A latching push button: the button cap with a lamp; pressing sinks it past the catch, releasing into on settles it at the latch on the part spring with the lamp lit. Toggle group puts the keys in a row.
Use it for
- A mode or a tool that stays on until you turn it off, shown as a key: "Grid", "Snap", Bold / Italic / Underline.
- ToggleGroup for a set of such keys, several at once (multiple) or at most one.
Don't use it for
- A setting in a list (use a switch), one of several views that is always chosen (use a switcher), or an action that happens once (use a button).