Basic Usage
Props Reference
Component that opens the popover
Main popover content
Optional heading
Optional descriptive text
With Title and Description
Controlled State
Whether popover is open (controlled)
Initial open state (uncontrolled)
Event fired when popover opens or closes
Event fired after animation completes
Positioning
Which side of trigger to position popover
How to align popover relative to trigger
Distance between trigger and popover in pixels
Offset along the alignment axis
Hover Behavior
Opens popover when hovering over trigger
Delay before opening on hover (milliseconds)
Delay before closing when hover ends (milliseconds)
Modal Behavior
True: Traps focus, locks scroll, blocks outside clicksFalse: Allows page interaction (default for popover)'trap-focus': Only traps focus
Collision Handling
Minimum distance from viewport edges
Keep popover visible after anchor scrolls out of view
CSS positioning strategy
Compositional API
Popover Components
popover.root
Container for all popover parts.popover.trigger
Element that opens the popover.popover.portal
Portals popover to document body.popover.positioner
Positions the popover relative to trigger.popover.popup
Main content container.CSS selector of element to focus when opened
CSS selector of element to focus when closed
popover.title
Heading (h2 element).popover.description
Description text (p element).popover.close
Button to close popover.popover.arrow
Arrow pointing to trigger.popover.backdrop
Optional backdrop overlay.Styling Classes
Access predefined styles viaui.popover.class_names:
ROOT: Root element (empty)TRIGGER: Trigger element (empty)BACKDROP: Backdrop overlay (empty)PORTAL: Portal element (empty)POSITIONER: Positioner wrapper (empty)POPUP: Popover container with border and shadowARROW: Arrow pointerTITLE: Large semibold headingDESCRIPTION: Secondary textCLOSE: Close button (empty)
Animation
Smooth scale and opacity transitions:- Scales from 95% to 100%
- Fades from 0 to 1 opacity
- 150ms transition duration
Custom Anchor
CSS selector for custom anchor element (instead of trigger)
Accessibility
- Keyboard accessible (Escape to close)
- Focus management
- ARIA attributes
- Screen reader support
- Proper role semantics
Implementation Details
From source code atreflex_ui/components/base/popover.py:269:
- Built on Base UI Popover primitives
- High-level wrapper creates complete structure
- Default side_offset of 4px
- Minimum width of 9rem (144px)
- Rounded corners and shadow styling
- Flexible content with gap spacing