Actions
Button
A pill that runs one action when pressed, used for the commands of a screen such as "Mark as done" or "Continue".
In kanso-ui as Button
Anatomy
- Container: a pill (
radius-pill), 48px tall by default. - Icon, optional: 20px, before the label.
- Label: one to three words, 15px at weight 600.
- State layer: the label colour over the fill on hover and press.
Measurements
From the design’s stylesheet, each design token with the value kanso-ui gives it in light.
| Class | Property | Value |
|---|---|---|
k-btn | height | 48px (size-control-lg) |
padding | 0 24px (space-2xl) | |
border | 0 | |
border-radius | 999px (radius-pill) | |
gap | 8px (space-sm) | |
font | 600 15px/20px font-plain | |
k-btn--outline | border | 1px solid #8a8a8a (outline) |
k-btn--text | padding | 0 12px (space-md) |
k-btn--sm | height | 32px (size-control-sm) |
padding | 0 16px (space-lg) | |
font-size | 14px | |
k-btn--md | height | 40px (size-control-md) |
padding | 0 20px (space-xl) | |
k-btn--xl | height | 56px (size-control-xl) |
padding | 0 32px (space-3xl) | |
font-size | 16px | |
k-btn--block | width | 100% |
k-btn--on-spot-outline | border | 1px solid spotlight-line |
Tokens used
| Design token | In kanso-ui | Light | Dark |
|---|---|---|---|
accent | --kui-color-accent | #1a1a1a | #ececec |
on-accent | --kui-color-on-accent | #fafafa | #121212 |
ink | --kui-color-ink | #1a1a1a | #ececec |
on-ink | --kui-color-on-ink | #fafafa | #121212 |
container | --kui-color-container | #e9e9e9 | #2b2b2b |
outline | --kui-color-outline | #8a8a8a | #8c8c8c |
critical | --kui-color-critical | #b3261e | #f2b8b5 |
on-critical | --kui-color-on-critical | #ffffff | #601410 |
spotlight-button | --kui-color-spotlight-button | #fafafa | #ffffff |
on-spotlight-button | --kui-color-on-spotlight-button | #1a1a1a | #1a1a1a |
spotlight-tonal | --kui-color-spotlight-tonal | rgba(255, 255, 255, 0.16) | rgba(255, 255, 255, 0.14) |
spotlight-line | --kui-color-spotlight-line | rgba(255, 255, 255, 0.6) | rgba(255, 255, 255, 0.6) |
on-spotlight | --kui-color-on-spotlight | #ffffff | #ffffff |
focus-ring | --kui-color-focus-ring | #1a1a1a | #ececec |
radius-pill | --kui-radius-kanso-pill | 999px | 999px |
size-control-sm | --kui-sizing-kanso-control-sm | 32px | 32px |
size-control-md | --kui-sizing-kanso-control-md | 40px | 40px |
size-control-lg | --kui-sizing-kanso-control-lg | 48px | 48px |
size-control-xl | --kui-sizing-kanso-control-xl | 56px | 56px |
size-icon-md | --kui-sizing-kanso-icon-md | 20px | 20px |
space-sm | --kui-spacing-kanso-sm | 8px | 8px |
space-md | --kui-spacing-kanso-md | 12px | 12px |
space-lg | --kui-spacing-kanso-lg | 16px | 16px |
space-xl | --kui-spacing-kanso-xl | 20px | 20px |
space-2xl | --kui-spacing-kanso-2xl | 24px | 24px |
space-3xl | --kui-spacing-kanso-3xl | 32px | 32px |
state-hover | --kui-state-layer-opacity-kanso-hover | 0.08 | 0.08 |
state-pressed | --kui-state-layer-opacity-kanso-pressed | 0.12 | 0.12 |
state-disabled-container | --kui-state-layer-opacity-kanso-disabled-container | 0.12 | 0.12 |
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 |