Modality
A layer over the page costs people their place, so pick the lightest one that does the job. Layers share one set of rules for where they open, what sits on top and which one answers Escape.
Choosing a layer
Start from what people have to do, and move down the list only when the lighter layer cannot hold it. An action that can be undone needs no layer at all: carry it out and offer Undo.
- A name or a shortcut for a control
- Tooltip
- Commands for an item or a view
- Menu
- A few controls for one item, with the page still in use
- Popover
- Details or settings read against the page
- Side sheet
- An answer or a short task that has to come first
- Dialog
What sits on top
Layers stack in a fixed order. Tooltips, menus and popovers sit on top, since they open from a control people can reach, and while a dialog is open that control is in the dialog. Toasts sit above dialogs so a result is seen. The dimmed page lies under both.
- Header
- layer 40
- --layer-header
- Dialog and sheet
- layer 60
- --layer-dialog
- Toast
- layer 70
- --layer-toast
- Tooltip, menu and popover
- above the toast
One at a time
One menu or popover is open at a time, and opening another closes the first. A submenu, the list of a field and a tooltip may still open inside it or inside a dialog. When a popover needs a popover of its own, move its content into a side sheet.
One dialog or sheet is open at a time. When a task in a dialog leads to another, close the first before the second opens. The only layer that may open over a dialog is a question about that dialog, such as Discard the changes?
Escape and focus
A menu in a dialog takes two presses of Escape. Each press closes only the layer in front.
- Escape
- closes the front layer only
- A layer opens
- focus moves into it
- A layer closes
- focus returns to the control that opened it
- That control is gone
- the next row, then the previous row, then the list
- Tab in a menu or popover
- leaves the layer and closes it
- Behind a dialog or sheet
- the page ignores pointer, keyboard and screen reader, and stops scrolling
Staying on screen
A layer is placed against the window, not inside the box that holds its trigger, so no scrolling list or card can cut it off. It opens where there is room, keeps 8 px from the edges, and scrolls inside itself when it is taller than the space it has.
When the page scrolls, an anchored layer follows its trigger and closes once the trigger has left the view.
From open to closed
Loading: the layer opens at once with its frame, and a skeleton in the shape of the content fills the body. Empty: one sentence says what is missing and offers the next step.
Error: a message at the top of the body says what failed, and the entries stay as typed. Success: the layer closes, focus returns, and a toast confirms the result when it is out of view.
Board admins
Board admins
No other admins yet
Add candidate
Could not save. Try again.