Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zendeskgarden/website/llms.txt
Use this file to discover all available pages before exploring further.
Installation
When to use
Use a Toggle button:- To see or compare the results of a settings change in real time
- To activate a mode (such as bold text or dark mode) that takes immediate effect
- To let users select from a list of settings — use Checkboxes instead
Unlike a Checkbox (which is used for selection), a Toggle button is used for activation. The key distinction is immediacy: toggling it takes effect right away, without a form submission step.
Usage
Default
TheisPressed prop controls the on/off state. ToggleButton communicates its state to assistive technologies via the aria-pressed attribute.
Disabled
A disabled Toggle button prevents user interaction. It does not appear in the tab order, cannot receive focus, and may not be read aloud by a screen reader.Sizes
Toggle buttons can be small, medium, or large. The default size is medium.Types
Toggle buttons share the same visual types asButton: default, primary, and basic.
Accessibility
ToggleButton automatically sets aria-pressed="true" when isPressed is true and aria-pressed="false" when it is false. This communicates the button’s current state to screen readers without any additional markup.
API
ToggleButton props
The current pressed (on/off) state of the button. Maps to
aria-pressed.Applies filled primary styling.
Applies text-only basic styling (no border or background).
Applies danger styling.
Applies neutral styling, reducing visual emphasis.
Stretches the button to fill its container’s full width.
Controls the button’s size.
Prevents user interaction and applies disabled styling.