A two-state button that can be either on or off, providing users with a clear way to switch between binary states.
Aspect | Best Practice |
---|---|
Usage | Use toggles for binary states like enabling/disabling features, showing/hiding content, or switching between two modes. |
Content | Use clear labels, icons, or both to communicate the toggle’s purpose and current state. |
Behavior | Provide immediate visual feedback when the state changes, with smooth transitions between states. |
States | Ensure clear visual distinction between on/off states, with appropriate hover, focus, and disabled states. |
Feedback | The toggle should clearly indicate its current state without requiring additional text or indicators. |
Examples | Feature toggles, visibility controls, format options (bold, italic), or mode switches (light/dark theme). |
ToggleGroup
component to group related toggles together with appropriate spacing.