Skip to content

Popover

A wrapper around React Aria’s DialogTrigger and Popover components. Unlike Tooltip, a Popover can contain interactive elements such as forms, links, or buttons.

Terminal window
npx @a2ra/cli add popover
{
"type": "Popover",
"props": {
"triggerLabel": "Filter options",
"placement": "bottom"
},
"children": [
{
"type": "Form",
"props": { "gap": "sm" },
"children": [
{ "type": "Checkbox", "props": { "label": "In stock only", "value": "instock" } }
]
}
]
}
PropTypeDescription
triggerLabelstringLabel for the trigger button
placementtop
bottom default
left
right
Preferred position
isOpenbooleanControlled open state
defaultOpentrue
false default
Open on mount
offsetnumberDistance from the trigger in pixels. Default: 8
crossOffsetnumberPerpendicular offset in pixels. Default: 0
shouldFliptrue default
false
Flip to opposite side when out of bounds
isKeyboardDismissDisabledtrue
false default
Prevent Escape from closing
maxHeightnumberMaximum height in pixels before scrolling
childrennode[]Content rendered inside the popover
  • Use Tooltip for non-interactive hints. Use Popover when the content has clickable elements.
  • Escape closes the popover and returns focus to the trigger by default.
  • maxHeight enables internal scrolling for long content without affecting the page layout.