Skip to main content

Popover

Rich content in a floating panel, opened by click.

In Dense data

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Dense data: Filters next to the column.

  • Use it when: Extra detail or a small control next to what it explains, on any device.
  • Not when: A one-line hint (tooltip), or a task that should block the page (dialog).

Instead:

Words​

  • Lead with the object, then the state: "Alert 2041 contained."
  • Use numbers, not words for numbers.
  • One verb per button. No "please", no exclamation marks.
  • Use: Investigate, Filter, Assign, Escalated, Resolved. Avoid: Oops, Awesome, Please, Simply.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Delete
  • content.action.retry: Retry
  • content.action.empty-action: Change filters

See Voice and tone for the whole voice.

Accessibility and keyboard​

KeyboardWhat happensNot
undefinedEscape closes it and returns focus.undefined

Test before you ship:

  • The trigger says it opens a panel and whether it is open. undefined

Use it in code​

npx open-ds add popover

The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.

Tokens it reads​

Popover reads 10 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Popover's tokens to change Popover alone.

Changes with theme

Dense data decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.

PartIts token and the semantic it aliasesValue
Shared
Transition panels durationcomponent.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration)duration.fast:120ms
Content
Cornercomponent.popover.content.radiusradius.controlvar(--popover-content-radius)radius.2:0.125rem
Fill
Changes with theme
component.popover.content.backgroundcolor.surface.raisedvar(--popover-content-background)Lightslate.light.0:#FFFFFFDarkslate.dark.100:#262D38
Paddingcomponent.popover.content.paddingspace.inset.containervar(--popover-content-padding)space.16:1rem
Text
Changes with theme
component.popover.content.labelcolor.text.primaryvar(--popover-content-label)Lightslate.light.900:#161B23Darkslate.dark.900:#F7F8FA
Shadow
Changes with theme
component.popover.content.shadowelevation.overlayvar(--popover-content-shadow)Lightshadow.overlayDarkshadow.overlay-dark
Header
Gapcomponent.popover.header.gapspace.gap.tightvar(--popover-header-gap)space.4:0.25rem
Text sizecomponent.popover.header.font-sizetype.body.font-sizevar(--popover-header-font-size)font.size.14:0.875rem
Title
Weightcomponent.popover.title.font-weighttype.label.font-weightvar(--popover-title-font-weight)font.weight.500:500
Description
Text
Changes with theme
component.popover.description.labelcolor.text.mutedvar(--popover-description-label)Lightslate.light.600:#535D6DDarkslate.dark.400:#969FAD
From the system
Edge
Changes with theme
color.border.default
straight from the system, through --border
Lightslate.light.200 · #DDE2EADarkslate.dark.100 · #262D38