Toggle switches are digital on/off switches. They prompt users to choose between two mutually exclusive options and always have a default value.
Demo
Note
- Alternatively, a toggle is also called a 'switch'.
- This toggle uses a hidden checkbox to adjust the styling for the checked state.
States & Variations
Default
The default toggle.
Checked
When the input is clicked, an attribute of checked
is added.
Anatomy
- Toggle
- Toggle Switch / Toggle Checkbox (Hidden)
- Toggle Label