Toggle
Toggle
A pressable element that switches between two states · on and off.
$ npx verticallyworks add toggleDoes the binary on/off axis conflict with vertical reading direction, or does its perpendicular orientation provide useful contrast?
DecisionIn a vertical interface the toggle runs on the reading axis · the thumb travels up for on, matching the direction the eye already moves.
Default
A vertical list: two cells stacked as columns flowing right-to-left, each reading top→bottom. The toggle runs on that same axis · thumb up = on · so the control matches the reading direction instead of cutting across it. The preview updates live.
Source
The exact file npx verticallyworks add toggle copies into your project · yours to edit. Styling comes entirely from the design tokens.
Guidance
- Run the toggle on the reading axis · thumb up = on, matching how the eye moves
- Always pair with a label that explains current state effect
- Use haptic feedback on state change in native implementations
- Rotate a horizontal toggle with transform · build the vertical travel natively
- Use color alone to convey state
- Place toggle labels vertically unless they are single CJK characters
Accessibility
role='switch', aria-checked. Space to toggle. Label describes effect, not control name.
In a fully vertical settings panel, does a horizontal toggle create useful contrast or cognitive dissonance?