Popover
An anchored floating surface for lightweight contextual content.
PopoverView sourceExample
The preview is interactive. The code below it is the docs demo source; demo-only layout classes can be omitted in application code.
import { Button, Popover } from "innate-ui";
export function PopoverDemo() {
return (
<Popover side="bottom" align="center">
<Popover.Trigger>
<Button>Open Popover</Button>
</Popover.Trigger>
<Popover.Content>
<h2>Popover Title</h2>
<p>This is a popover.</p>
</Popover.Content>
</Popover>
);
}API reference
This table is generated from Innate UI's exported TypeScript declarations and JSDoc. Native element attributes inherited by a prop type are not repeated here.
PopoverProps
| Prop | Type | Default |
|---|---|---|
childrenrequiredPopover trigger, optional anchor, and content parts. | JSX.Children | — |
openWhether the popover is open. | JSX.ValueOrCell<boolean> | false |
sidePreferred side of the anchor. | JSX.ValueOrCell<PopoverSide> | "bottom" |
alignPreferred alignment along the anchor edge. | JSX.ValueOrCell<PopoverAlign> | "center" |
sideOffsetGap in pixels between the anchor and content. | JSX.ValueOrCell<number> | 8 |
collisionPaddingViewport padding used when resolving collisions. | JSX.ValueOrCell<number> | 8 |
onOpenChangeCalled when the popover requests an open-state change. | (open: boolean, reason?: PopoverCloseReason) => void | — |
triggerRefOptional externally owned trigger element reference. | SourceCell<HTMLElement | null> | — |