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
Variants and sizes
- Item, with or without an icon:
k-menu__item. - Item with a shortcut:
k-menu__shortcutinside it. - Destructive item:
k-menu__item--critical, label and icon incritical, after a separator.
States
- Rest: an
inklabel onsurface. - Hover: the item's content colour at 8% (
state-hover) over it; pressed: 12% (state-pressed). - Focus: the 2px
focus-ring, 2px outside the item. - Open and closed: the trigger's
aria-expandedsays which; the closed menu ishidden. - Critical: the verb ("Leave project"), its place after the separator and the
criticalcolour say it together. - Disabled: none. Leave out an action that can't be taken.
Do and don’t
Do
Start every label with a verb that names the outcome: Edit project, Export payments.
Put the destructive action last, after a separator, and confirm it in a Dialog.
Don’t
Nest menus, and don't put more than seven items in one.
Open a second menu or a snackbar over an open menu.
Use
accentin a menu.
What you provide
- The trigger's name.
- The items, in groups: label, optional icon name, optional shortcut, whether it is destructive, and the action.