Popover
A panel anchored to a trigger. It scales out from the side it opens on, flips and shifts to stay in view, closes on Escape or an outside click, and can trap focus when modal.
pixikit.com/docs/components/popover
Customize
Default open
Placement
Offset10px
Match width
Modal
Arrow
Width272px
Portal
Props
13| Name | Type | Default | Description |
|---|---|---|---|
trigger | ReactNode | "Open" | What the trigger button shows. The button is owned by the popover and carries aria-expanded and aria-controls. |
children | ReactNode | None | The panel content. |
open | boolean | None | Whether the panel is open, when you hold the state. |
defaultOpen | boolean | None | Whether the panel is open at first, when the popover holds the state. |
onOpenChange | (open: boolean) => void | None | Called with the next open state. |
placement | Placement | "bottom" | Where the panel sits around the trigger; it flips when there is no room. |
offset | number | 8 | Gap in px between the trigger and the panel. |
matchWidth | boolean | false | Gives the panel the width of the trigger. |
modal | boolean | false | Traps focus inside the panel and returns it to the trigger on close. |
arrow | boolean | false | Draws a small arrow pointing at the trigger. |
width | number | None | Width of the panel in px; leave out to fit the content. |
portal | boolean | true | Renders the panel in a portal on the page body; turn off to keep it inline. |
className | string | None | Extra classes for the panel. |