Skip to content

Overlays

Popover

Small non-modal panel next to its trigger for an explanation or a few details.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Playground

Change the props. The controls come from the documented props.
tsx
<Popover trigger="What is a token?" title="Token">
  A named value, such as a colour or a spacing, that every component reads.
</Popover>

Usage

When to use

Use a popover to explain something right where it appears: a term, a status, a number whose meaning isn't obvious.

When not to use

  • For a decision or a form: use Dialog.
  • For content most people need: show it on the page.
  • For longer content that opens in place: use Disclosure.

How it works

A small button opens a panel next to it. It is a non-modal dialog: focus moves in, Esc or a click outside closes it, and focus returns to the trigger. The panel flips to the other side when there is no room and is 320px wide at most.

Content guidelines

The trigger asks the question people have (“What is the contrast gate?”). The title names the topic, the body answers in one or two sentences.

Do and don’t

Do
  • Use it to explain a term, a status or a number where it appears.
Don’t
  • Don't put forms or decisions in a popover; use Dialog.
  • Don't hide information people need to complete the task.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. triggerSmall button in the button style.
  2. containerCard surface, control border, 12px radius, 320px wide at most.
  3. titleSemibold heading that names the dialog.
  4. bodySmall secondary text.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { Popover } from "@/ds";

Explaining a term

Every colour is checked by the contrast gate.

Props

Checked against the component's TypeScript type on every build.
Popover props
NameTypeDefaultDescription
trigger (required)string–Label of the trigger button.
triggerVariant"primary" | "accent" | "secondary" | "ghost""secondary"ghost for an inline “What is this?”.
title (required)string–Heading inside the popover; names it.
children (required)ReactNode–One or two sentences, or a short list.
placement"bottom" | "top""bottom"Preferred side; flips when there is no room.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by Popover
TokenTierValueUtility
popover.bgcomponent#FFFFFF
popover.bordercomponent#8A8578
popover.paddingcomponent16px
popover.radiuscomponent12px
popover.widthcomponent320px
spacing.2semantic8px
text.primarysemantic#0A0A0B
text.secondarysemantic#555555
type.small.sizesemantic14px
weight.semiboldsemantic600

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

Popover keyboard interactions
KeyAction
Enter / SpaceOpens the popover from its trigger.
EscCloses it; focus returns to the trigger.

Semantics and focus

  • React Aria dialog without a modal backdrop: focus moves into the popover and returns to the trigger on close.
  • The title labels the dialog; Esc and a click outside close it.

Contrast

Popover contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.card19.794.5Pass
text.secondary on surface.card7.464.5Pass
border.control on surface.card3.683.0Pass