Component 11 · Forms
Switch
Apply an immediate binary setting.
Overview
Apply an immediate binary setting. It transforms operator input into a labeled domain value while preserving recoverable input through validation, delay and offline queuing.
When to use
Use HE/Switch when you need to apply an immediate binary setting. Keep its role distinct from transport freshness, animal-health severity and model confidence.
Example
<label class="he-switch"><input type="checkbox" checked><span class="he-switch__track"></span><span>Heartbeat alert</span></label>Anatomy
1Persistent label
2Control
3Help or error
4Sync state
Anatomy stays identical in Pasture and Atlantic. A responsive layout may wrap or stack parts, but reading order and focus order remain equivalent.
Variants and states
Variants
States
Accessibility
Name the setting, expose checked state, and avoid Save when the change is immediate.
- Maintain a visible keyboard focus indicator and a logical focus sequence.
- Never rely on colour alone for operational, freshness or severity state.
- Keep touch targets at least 44 × 44 px unless the target is an inline text link.
Cross-platform contract
| Surface | Canonical name | Status |
|---|---|---|
| Figma | HE/Switch | stable |
| Web | .he-switch | implemented |
| Flutter | HeSwitch | implemented |
| Token root | component.switch | generated |