Selection
Slider
A slider sets a number in a known range by dragging, tapping or the arrow keys, such as the length of a session, and always shows the value in text.
In kanso-ui as Slider
Anatomy
- Label (in
k-slider__head): what it sets, "Session length". - Value (
k-slider__value): the value and its unit infont-mono, "25 min". - Track: 6px,
accentup to the thumb, like a meter's fill, andcontainerafter it. - Thumb: a 24px
inkcircle with a 3pxsurfaceborder andshadow-1.
Measurements
From the design’s stylesheet, each design token with the value kanso-ui gives it in light.
| Class | Property | Value |
|---|---|---|
k-slider | gap | 8px (space-sm) |
min-width | 0 |
Tokens used
| Design token | In kanso-ui | Light | Dark |
|---|---|---|---|
paper | --kui-color-paper | #fafafa | #121212 |
surface | --kui-color-kanso-surface | #ffffff | #1c1c1c |
container | --kui-color-container | #e9e9e9 | #2b2b2b |
accent | --kui-color-accent | #1a1a1a | #ececec |
ink | --kui-color-ink | #1a1a1a | #ececec |
ink-muted | --kui-color-ink-muted | #5c5c5c | #b3b3b3 |
focus-ring | --kui-color-focus-ring | #1a1a1a | #ececec |
shadow-1 | --kui-shadow-kanso-1 | 0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.04) | 0px 1px 2px 0px rgba(0, 0, 0, 0.5) |
space-sm | --kui-spacing-kanso-sm | 8px | 8px |
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 |
font-mono | --kui-typography-font-family-mono | 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace | 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace |