# Popover primitive
Source: https://texuli.com/primitives-page/popover/
# Popover
A non-modal (or modal) panel anchored to a button.
Import
`import * as Popover from '@texuli/primitives/popover';`
Pattern
[Disclosure / dialog (WAI-ARIA APG)](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/)
Size budget
16.0 KiB gzip for @texuli/primitives/popover
Reference
`packages/primitives/docs/prim-popover.md`
## Live demo
Right to left
Loading the Popover demo…
## Anatomy
Popover anatomy: each box holds the parts inside it.
- `Popover.Root``Popover.Trigger`
- `Popover.Content``Popover.Close`
## Behavior checks
`tests/behavior/scenarios/popover.spec.ts` runs **9 rows** against the Popover scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 9 rows
- the trigger reports collapsed, then expanded
- opening moves focus into the panel
- Escape closes it and focus returns to the trigger
- a pointer press outside closes it
- it is not modal: focus can move to the page behind it
- it opens below its trigger, 6 px away
- the Apply button closes it
- a modal popover keeps Tab and Shift+Tab inside it
- Escape closes a modal popover and focus returns to its trigger
### Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 16.0 KiB gzip for `@texuli/primitives/popover` (`pnpm size`).
- Open-to-focus: p75 at most 50 ms (asserted with `TEXULI_PERF=1`).
Popover
A non-modal (or modal) panel anchored to a button.
- Import
import * as Popover from '@texuli/primitives/popover';- Pattern
- Disclosure / dialog (WAI-ARIA APG)
- Size budget
- 16.0 KiB gzip for @texuli/primitives/popover
- Reference
packages/primitives/ docs/ prim-popover.md
Loading the Popover demo…
Anatomy
Popover.RootPopover.TriggerPopover.ContentPopover.Close
Behavior checks
tests/behavior/scenarios/popover.spec.ts runs 9 rows against the Popover scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 9 rows
- the trigger reports collapsed, then expanded
- opening moves focus into the panel
- Escape closes it and focus returns to the trigger
- a pointer press outside closes it
- it is not modal: focus can move to the page behind it
- it opens below its trigger, 6 px away
- the Apply button closes it
- a modal popover keeps Tab and Shift+Tab inside it
- Escape closes a modal popover and focus returns to its trigger
Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 16.0 KiB gzip for
@texuli/primitives/popover(pnpm size). - Open-to-focus: p75 at most 50 ms (asserted with
TEXULI_PERF=1).