Navigation
Menu
A menu is a short list of actions that floats over the page from a button, such as a project's options: Edit project, Export payments, Leave project.
In kanso-ui as Menu
Anatomy
- Trigger: an icon button (
k-iconbtn,more_horiz) or a button. - Container (
k-menu):surface,radius-mdcorners,shadow-2, at least 220px wide. - Item (
k-menu__item): 44px, a 20pxink-mutedicon and a label. - Shortcut (
k-menu__shortcut): the keys in mono,ink-muted, at the end of the item. - Separator (
k-menu__sep): adividerhairline between groups of items. - Critical item (
k-menu__item--critical): the destructive action, last.
Measurements
From the design’s stylesheet, each design token with the value kanso-ui gives it in light.
| Class | Property | Value |
|---|---|---|
k-menu | padding | 4px (space-xs) 0 |
min-width | 220px | |
border-radius | 12px (radius-md) | |
box-shadow | shadow-2 |
Tokens used
| Design token | In kanso-ui | Light | Dark |
|---|---|---|---|
surface | --kui-color-kanso-surface | #ffffff | #1c1c1c |
shadow-2 | --kui-shadow-kanso-2 | 0px 2px 6px 0px rgba(0, 0, 0, 0.08), 0px 8px 20px 0px rgba(0, 0, 0, 0.1) | 0px 4px 16px 0px rgba(0, 0, 0, 0.6) |
radius-md | --kui-radius-kanso-md | 12px | 12px |
ink | --kui-color-ink | #1a1a1a | #ececec |
ink-muted | --kui-color-ink-muted | #5c5c5c | #b3b3b3 |
critical | --kui-color-critical | #b3261e | #f2b8b5 |
divider | --kui-color-divider | #e3e3e3 | #333333 |
focus-ring | --kui-color-focus-ring | #1a1a1a | #ececec |
state-hover | --kui-state-layer-opacity-kanso-hover | 0.08 | 0.08 |
state-pressed | --kui-state-layer-opacity-kanso-pressed | 0.12 | 0.12 |
space-xs | --kui-spacing-kanso-xs | 4px | 4px |
space-md | --kui-spacing-kanso-md | 12px | 12px |
space-lg | --kui-spacing-kanso-lg | 16px | 16px |
size-icon-md | --kui-sizing-kanso-icon-md | 20px | 20px |
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 |