Selection
Switch
A switch turns a setting on or off the moment it is touched, with nothing to save, such as reminders for due tasks.
In kanso-ui as Switch
Anatomy
- Track: a 52 by 32px pill with a 2px border.
- Thumb: a circle that slides from start to end.
- Label: the setting, worded so that on reads as true.
- Reason (optional): under a disabled switch, saying why.
Measurements
From the design’s stylesheet, each design token with the value kanso-ui gives it in light.
| Class | Property | Value |
|---|---|---|
k-switch | gap | 12px (space-md) |
min-height | 48px (size-control-lg) | |
font | 400 15px/20px font-plain |
Tokens used
| Design token | In kanso-ui | Light | Dark |
|---|---|---|---|
paper | --kui-color-paper | #fafafa | #121212 |
surface-sunken | --kui-color-surface-sunken | #f0f0f0 | #262626 |
ink | --kui-color-ink | #1a1a1a | #ececec |
on-ink | --kui-color-on-ink | #fafafa | #121212 |
outline | --kui-color-outline | #8a8a8a | #8c8c8c |
focus-ring | --kui-color-focus-ring | #1a1a1a | #ececec |
radius-pill | --kui-radius-kanso-pill | 999px | 999px |
size-control-lg | --kui-sizing-kanso-control-lg | 48px | 48px |
space-md | --kui-spacing-kanso-md | 12px | 12px |
space-3xl | --kui-spacing-kanso-3xl | 32px | 32px |
state-disabled-content | --kui-state-layer-opacity-kanso-disabled-content | 0.38 | 0.38 |
font-plain | --kui-typography-font-family-plain | 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif | 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif |
--k-motion-short | its own value | — | — |
--k-motion-medium | its own value | — | — |
--k-ease-standard | its own value | — | — |
--k-ease-spring | its own value | — | — |