Popover opens a small raised plate from a key: a title, a line or two, perhaps a control. Focus moves into it on open and back to the key on close; Escape and a press outside close it. For a list of actions use Menu; for a single line that repeats a control's name use Tooltip.
Example#
Usage#
Use a popover for a few words or a small control that people open on purpose: why a price moved, a short definition, a quick setting. Focus moves into it on open and back to its key on close.
- Parts.
Popoverwith aPopoverTrigger(a Button) and aPopoverContentholding an optionaltitle, adescriptionand any children.closeButtonadds a quiet close key. - Closing. Escape and a press outside close it; a
PopoverClosecan close it from inside. - A list of actions is a
Menu. One line that repeats a control's name is aTooltip. Anything long or with a form is aDialogor aDrawer.
Anatomy#
Why the estimate moved
- PlateRaised surface, 2 px rule, at most 360 px wide.
.mk-popover-popup - HeadThe title and the close key.
data-mk-part="head" - DescriptionOne or two sentences in body UI type.
.mk-popover-description - Close keyA quiet small IconButton named Close.
.mk-popover-close
Volume#
Reading layer: identical at every volume.
Quiet
Why the estimate moved
Studio
Why the estimate moved
Press
Why the estimate moved
Rave
Why the estimate moved
Content#
- The trigger asks the question the popover answers: "Why this price?"
- The title restates it as a statement; the description answers it in one or two sentences.
- No essays: if it needs a heading and paragraphs, it needs a page or a dialog.
Do and don't#
Do
Why the estimate moved
Don't
A popover holding a six-field contact form.
Accessibility#
- The popup is a dialog named by its
titleand described by itsdescription. - It portals to the body with its trigger's theme, colourway, stock, plate and contrast (20 §1.9).
- Fades and grows from .96 in 140 ms; reduced motion keeps the fade.
| Keys | What happens |
|---|---|
| EnterorSpace | On the trigger: opens the popover and moves focus into it |
| Tab | Moves through the popover's controls |
| Escape | Closes it; focus returns to the trigger |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-text | --mk-surface-raised | ui | not in this look | not in this look |
--mk-text-2 | --mk-surface-raised | ui | not in this look | not in this look |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | none | |
defaultOpen | boolean | none | |
onOpenChange | ((open: boolean) => void) | none | |
children required | ReactNode | none |
Tokens#
System tokens (20)
Changelog#
Arrived in 0.9.0.
ComboboxandComboboxItem(a case- and accent-insensitive filter by default, groups, chips formultiple, "Searching…", an empty message, a live result count, andinlinefor a list printed in place),PopoverwithPopoverTrigger,PopoverContentandPopoverClose,Menuwith its eleven parts (shortcuts asKbdcaps, checkbox and radio items, group labels, separators, submenus), andToastProviderwithuseToast(a slab pill, one at a time with three waiting, 5.2 s with a drain bar that holds while the region is hovered, focused or the window is away). Read the whole entryComboboxgives its inline list an id and the input's name in the server markup and marks its box as the input's focus-ring host, and a highlighted row's second line prints in--mk-text; theEmptyStateandPopoverdescriptions print in the meta role (16 px, 500, so--mk-text-2clears the APCA floor);SplashTitle's Quiet heading prints on its own paper plate and wraps inside its cell; theToastviewport and specimen keep one column no wider than their box;ProofSheet's frame links draw the focus ring. Read the whole entry