Popover
Rich content in a floating panel, opened by click.
In Brand expressive
See it live
npm run storybookWhen to use it
In Brand expressive: A product preview that opens on tap.
- 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
- Headlines are short and bold. Three to six words.
- Verbs that move: Join, Try, Go.
- Playful in headlines, plain in errors.
- Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.
The labels components use, from the voice tokens:
content.action.commit: Gocontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Explore the drop
See Voice and tone for the whole voice.
Accessibility and keyboard
| Keyboard | What happens | Not |
|---|---|---|
| undefined | Escape 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.
Brand expressive 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.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Shared | ||
| Transition panels duration | component.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration) | duration.moderate:200ms |
| Content | ||
| Corner | component.popover.content.radiusradius.controlvar(--popover-content-radius) | radius.999:9999px |
| Fill Changes with theme | component.popover.content.backgroundcolor.surface.raisedvar(--popover-content-background) | Lighttaupe.light.0:#FFFFFFDarktaupe.dark.100:#33241F |
| Padding | component.popover.content.paddingspace.inset.containervar(--popover-content-padding) | space.32:2rem |
| Text Changes with theme | component.popover.content.labelcolor.text.primaryvar(--popover-content-label) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Shadow Changes with theme | component.popover.content.shadowelevation.overlayvar(--popover-content-shadow) | Lightshadow.overlayDarkshadow.overlay-dark |
| Header | ||
| Gap | component.popover.header.gapspace.gap.tightvar(--popover-header-gap) | space.8:0.5rem |
| Text size | component.popover.header.font-sizetype.body.font-sizevar(--popover-header-font-size) | font.size.17:1.0625rem |
| Title | ||
| Weight | component.popover.title.font-weighttype.label.font-weightvar(--popover-title-font-weight) | font.weight.700:700 |
| Description | ||
| Text Changes with theme | component.popover.description.labelcolor.text.mutedvar(--popover-description-label) | Lighttaupe.light.600:#6B544ADarktaupe.dark.400:#B5988A |
| From the system | ||
| Edge Changes with theme | color.border.default straight from the system, through --border | Lighttaupe.light.200 · #F2DCCFDarktaupe.dark.100 · #33241F |