Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Popover
  3. API and Development

Popover

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Popover displays floating content anchored to a trigger element, useful for tooltips, menus, forms, or additional information that appears on demand. It provides a flexible floating content interface that positions itself relative to a trigger element, supporting various positioning options and interaction patterns. Built on Radix UI's Popover component, it ensures consistent popover patterns across the interface with full keyboard and screen reader accessibility.
Props
Popover (Root)
NameDefaultDescription
childrenrequiredPopover components (PopoverTrigger, PopoverContent, etc.).
openWhether the popover is open (controlled component).
onOpenChangeCallback function called when the popover open state changes: (open: boolean) => void.
preventOutsideClosefalseWhether to prevent the popover from closing when clicking outside.
PopoverTrigger
NameDefaultDescription
childrenrequiredThe element that triggers the popover when clicked.
PopoverContent
NameDefaultDescription
childrenrequiredThe content to display inside the popover.
sidePopoverContentSide.BottomThe side of the trigger where the popover appears. Options: Top, Bottom, Left, Right.
avoidCollisionstrueWhen false, keeps the requested side even when space is limited.
collisionPadding0Distance in pixels from the collision boundary edges. Accepts a number or a partial { top, right, bottom, left } object.
collisionBoundaryviewportElement or array of elements treated as obstacles when avoidCollisions is true. Pass an open drawer so the popover flips/shifts around it.
sideOffset4Distance in pixels between the trigger and popover.
alignPopoverContentAlign.CenterAlignment of the popover relative to the trigger. Options: Start, Center, End.
alignOffset0Additional offset in pixels for alignment adjustment.
containerCustom container element for the popover portal. Defaults to PopoverManager or document.body.
onOpenAutoFocusCallback function called when the popover opens and focus is automatically set: (event: Event) => void.
onEscapeKeyDownCallback when Escape is pressed while open: (event: Event) => void.
PopoverClose
NameDefaultDescription
childrenrequiredThe element that closes the popover when clicked.
PopoverAnchor
NameDefaultDescription
childrenrequiredThe anchor element for positioning.
asChildfalseWhether to merge props with the child element.
virtualRefVirtual reference for custom positioning: React.RefObject<{ getBoundingClientRect: () => DOMRect }>.
PopoverAnchor uses the Radix UI Popover primitive (not Themes Popover.Anchor) so it can nest under a Themes Popover.Root while positioning content relative to a non-trigger surface—for example a multi-select chips field that opens from focus or typing rather than a dedicated trigger button.
Basic Popover
Use for simple content overlays triggered by user interaction.
Popover with Form
Use popovers for contextual forms or input fields.
Popover with Menu
Use popovers for contextual menus or option lists.
Positioning
Control where the popover appears relative to the trigger.
Side Positioning
Position the popover on different sides of the trigger.
Alignment
Control how the popover aligns with the trigger.
Custom Offsets
Adjust spacing using offset props.
Controlled Popover
Control popover state programmatically.
Non-Dismissible Popover
Prevent the popover from closing when clicking outside.
Popover with Close Button
Include a close button within the popover content.
Custom Trigger
Use any element as a trigger, including custom components.
Virtual Anchor
Use a virtual anchor for fixed positioning or custom placement.
Prevent Auto Focus
Control focus behavior when the popover opens.
@prepared911/ui Popover
The design-system popover is not a path-only rewrite of this page. sideOffset is a space step (0, 4, 8, 12, 16, 20, or 24); the annotation popover uses 20. Outside dismiss that must skip a marker or a portaled menu uses isOutsideExempt(target) instead of ignoreOutsideCloseSelector. The platform reports an outside press as light-dismiss, and that change is not cancelable, so details.cancel() does not keep the popover open. A press the predicate accepts stays open; Escape still closes and returns focus to the trigger.
PopoverManager Setup
Include PopoverManager in your application to enable proper popover rendering.
Previous
Popover / Usage
Next
Accessibility / Keyboard Support
On this page
Props
Popover (Root)
PopoverTrigger
PopoverContent
PopoverClose
PopoverAnchor
Basic Popover
Popover with Form
Popover with Menu
Positioning
Side Positioning
Alignment
Custom Offsets
Controlled Popover
Non-Dismissible Popover
Popover with Close Button
Custom Trigger
Virtual Anchor
Prevent Auto Focus
@prepared911/ui Popover
PopoverManager Setup