Toggle
Toggles let users turn a single option on or off. They are typically used to enable or disable a setting.
Overview
catnip-toggle is a form-associated custom element (ElementInternals) that exposes a boolean state. The thumb wrapper is transparent; the cross-filled (off) and tick-filled (on) icons supply the full knob colour
The switch layout box is 36×20px at size m and 52×28px at size l.
Live example
Guidelines
- Use toggles for immediate binary settings; use Button or Link for navigation or deferred actions.
- Pair with short, action-oriented labels (for example “Enable tags”).
- Use
readonlywhen the current on/off value must remain reviewable and form-submittable but cannot be changed. - Use
disabledwhen the switch is unavailable and should leave the keyboard interaction model.