COMPONENTS
Switches
A switch class styles a native checkbox as an on/off control. Checked state, keyboard activation, form submission and disabled behavior remain native.
Usage
Markup: input.switch[type=checkbox] inside a label
Behaviour: Checked state, keyboard activation and submission remain native.
- Use switches for boolean settings. Keep a stable visible label; Space toggles the focused checkbox. Optional role="switch" communicates on/off semantics while checked remains the native input state.
- Place the checkbox inside its label for a comfortable label target. Add aria-describedby for explanatory text. Do not maintain aria-checked manually on a native checkbox.
- Size, shape, accent, borders and motion follow the parent. Switches keep opaque control backing, including inside a glass section. Reduced-motion preferences stop thumb transitions.
Component API and styling module · Inherited appearance settings
A native on/off setting
The label names the setting and activates its checkbox.
Help and disabled settings
Associated help text explains the setting. Native disabled prevents changes.
Receive one summary every Monday.
Shared defaults
Set accent and size on the parent; controls only need the switch class.
A sized labelled switch
The group label and switch consume the size setting once. A local switch size remains an independent override.