One contract: Switch
Loom Base 1.0.0, MIT
- Purpose
- Turns a single setting on or off, taking effect immediately.
- When not to use it
- The choice is only applied after pressing Save: use Checkbox.
- Choosing between more than two options: use RadioGroup.
- States
- off, on (off → on, on → off); flags: disabled
- Keyboard and role
- Space, Tab · role
switch, the same on native
- Tested behaviour
- 10 scenarios, run on web and native from this one file
Three of its 20 tokens, resolved from the component to the value| Component token | Resolves through | Value |
|---|
track.background:checked | semanticcolor.control.checked | primitivecolor.palette.dye-indigo.800 | #1e2a78 |
|---|
track.border-color | semanticcolor.border.strong | primitivecolor.palette.greige.500 | #716856 |
|---|
root.min-height | semanticsize.target.min | primitivesize.scale.24 | 24px |
|---|