Selection
Segmented control
A pill of two to five segments with exactly one selected, used to switch the view below it or the kind of thing a form adds.
In kanso-ui as SegmentedButton
Anatomy
- Track: a
surface-sunkenpill with a 4px inset. - Segments: buttons 36px tall, each with a one-word label.
- Selected segment:
surfacefill, 1pxoutlineborder,shadow-1, the label ininkat weight 600.
Measurements
From the design’s stylesheet, each design token with the value kanso-ui gives it in light.
| Class | Property | Value |
|---|---|---|
k-seg | padding | 4px (space-xs) |
border-radius | 999px (radius-pill) | |
gap | 2px | |
max-width | 100% |
Tokens used
| Design token | In kanso-ui | Light | Dark |
|---|---|---|---|
surface-sunken | --kui-color-surface-sunken | #f0f0f0 | #262626 |
surface | --kui-color-kanso-surface | #ffffff | #1c1c1c |
outline | --kui-color-outline | #8a8a8a | #8c8c8c |
ink | --kui-color-ink | #1a1a1a | #ececec |
ink-muted | --kui-color-ink-muted | #5c5c5c | #b3b3b3 |
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) |
radius-pill | --kui-radius-kanso-pill | 999px | 999px |
space-xs | --kui-spacing-kanso-xs | 4px | 4px |
space-sm | --kui-spacing-kanso-sm | 8px | 8px |
space-lg | --kui-spacing-kanso-lg | 16px | 16px |
state-hover | --kui-state-layer-opacity-kanso-hover | 0.08 | 0.08 |
state-pressed | --kui-state-layer-opacity-kanso-pressed | 0.12 | 0.12 |
focus-ring | --kui-color-focus-ring | #1a1a1a | #ececec |
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 |