Open the popover to compare the same surface, state model, and motion on different headless primitives.
Installation
npx shadcn@latest add @iconiq/r-popoverProps
Popover
4 props
Thin wrapper around `PopoverPrimitive.Root` that mirrors the resolved open state into local context so `PopoverContent` can infer presence automatically.
open
booleanControlled open state on the Radix root when you want React state to own visibility.
defaultOpen
booleanUncontrolled initial state forwarded to the underlying Radix popover root.
onOpenChange
(open: boolean) => voidCalled whenever Radix requests a state change through the trigger, outside interaction, or escape handling.
children
ReactNodeRequired
Composition surface for the trigger, optional anchor, and content primitives.
Notes
Wraps Radix Popover.Root and keeps the resolved open state in local context so PopoverContent can infer presence automatically.
Controlled and uncontrolled usage are both supported.
PopoverTrigger and PopoverAnchor
2 props
`PopoverTrigger` is a light wrapper around the Radix trigger with a larger default hit area when not using `asChild`, while `PopoverAnchor` remains the Radix positioning anchor.
asChild
booleanLets you render your own button, link, or wrapper element without adding an extra DOM node.
children
ReactNodeRequired
Interactive or layout content rendered by the trigger or anchor primitive.
Notes
PopoverTrigger is a light wrapper around the Radix trigger with a larger default hit area when not using asChild, while PopoverAnchor remains the Radix positioning anchor.
Both exports still accept the remaining interactive props for event handling and accessibility wiring.
PopoverContent
6 props
Animated content wrapper built on Radix Popover.Content and AnimatePresence.
open
booleanAccepted for backwards compatibility, but no longer required. The nearest `Popover` root state now drives content presence automatically.
children
ReactNodeRequired
Content rendered inside the animated panel.
className
stringMerged onto the motion.div panel for local width, spacing, or surface overrides.
align
"start" | "center" | "end"Default
centerForwarded to Radix Popover.Content to control horizontal alignment relative to the trigger or anchor.
sideOffset
numberDefault
8Forwarded to Radix Popover.Content to control the gap between the anchor and the floating panel.
collisionPadding
number | Partial<Record<Side, number>>Default
12Adds a little default breathing room from the viewport edge before collision handling nudges the popover inward.
Notes
Remaining Radix content props are forwarded through to PopoverPrimitive.Content, including side, collisionPadding, onEscapeKeyDown, and accessibility props.
The component always renders inside a Radix portal, reads the resolved placement for direction-aware motion, and uses the Radix transform-origin CSS variable so scaling stays anchored to the trigger.
The panel ships without drop shadow so the surface stays flat against the page.
Content size changes animate while the popover is open, so progressive disclosure and copy swaps do not snap abruptly.
Entry and exit animation are owned internally, so Motion-specific props such as initial, animate, exit, and transition are not part of the public prop surface.