Skip to main content

Popover

Rich content in a floating panel, opened by click.

In Multi-brand

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Multi-brand: Plan details and fee explanations, opened by tap on any device.

  • 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​

  • Shared structure: object, state, next step.
  • Brand tone lives in headlines and marketing copy, not in errors.
  • Errors and confirmations read the same in every brand.
  • Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Remove
  • content.action.retry: Try again
  • content.action.empty-action: Get started

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

Multi-brand decides what changes when you switch theme. Here a switch changes colors, type and shape, so the marked rows differ between its brands and 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.relaxed:320ms
Content
Corner
Changes with theme
component.popover.content.radiusradius.controlvar(--popover-content-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Fill
Changes with theme
component.popover.content.backgroundcolor.surface.raisedvar(--popover-content-background)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.100:#1E293B
Paddingcomponent.popover.content.paddingspace.inset.containervar(--popover-content-padding)space.24:1.5rem
Text
Changes with theme
component.popover.content.labelcolor.text.primaryvar(--popover-content-label)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Shadow
Changes with theme
component.popover.content.shadowelevation.overlayvar(--popover-content-shadow)Aster Lightshadow.overlayAster Darkshadow.overlay-darkBirch Lightshadow.overlayBirch Darkshadow.overlay-darkCoral Lightshadow.overlayCoral Darkshadow.overlay-dark
Header
Gapcomponent.popover.header.gapspace.gap.tightvar(--popover-header-gap)space.8:0.5rem
Text sizecomponent.popover.header.font-sizetype.body.font-sizevar(--popover-header-font-size)font.size.16:1rem
Title
Weightcomponent.popover.title.font-weighttype.label.font-weightvar(--popover-title-font-weight)font.weight.600:600
Description
Text
Changes with theme
component.popover.description.labelcolor.text.mutedvar(--popover-description-label)Aster Lightslate-deep.light.600:#4B5A6FAster Darkslate-deep.dark.400:#96A3B5Birch Lightslate-deep.light.600:#4B5A6FBirch Darkslate-deep.dark.400:#96A3B5Coral Lightslate-deep.light.600:#4B5A6FCoral Darkslate-deep.dark.400:#96A3B5
From the system
Edge
Changes with theme
color.border.default
straight from the system, through --border
Aster Lightslate-deep.light.200 · #E2E8F0Aster Darkslate-deep.dark.100 · #1E293BBirch Lightslate-deep.light.200 · #E2E8F0Birch Darkslate-deep.dark.100 · #1E293BCoral Lightslate-deep.light.200 · #E2E8F0Coral Darkslate-deep.dark.100 · #1E293B