# @fayegram-ai/faye-ui/overlays/popover

Public exports and dependency-resolved component properties, with usage and rendering guidance.

## Import

```tsx
import { Popover } from '@fayegram-ai/faye-ui/overlays/popover';
```

[Usage and behavior guide](/docs/floating/) · [API JSON](/api/packages/overlays/popover.json)

This entry declares a client boundary. Follow the rendering guide for framework integration.

## Public exports

| Name | Kind | Resolved declaration type |
|---|---|---|
| `Popover` | value | `{ readonly Root: typeof Base.Root; readonly Trigger: { (input: import("@base-ui/react/internals/types").NativeButtonProps & Omit<import("@base-ui/react/internals/types").WithBaseUIEvent<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, "className" \| "color" \| "defaultValue" \| "defaultChecked" \| "style"> & { className?: string \| ((state: import("@base-ui/react").PopoverTriggerState) => string \| undefined) \| undefined; render?: import("react").ReactElement<unknown, string \| import("react").JSXElementConstructor<any>> \| import("@base-ui/react").ComponentRenderFn<import("@base-ui/react").HTMLProps, import("@base-ui/react").PopoverTriggerState> \| undefined; style?: import("react").CSSProperties \| ((state: import("@base-ui/react").Pop… (full type in API JSON)` |

## Popover

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

### Popover.Root

| Property | Required | Type | Meaning |
|---|---|---|---|
| `actionsRef` | No | `React.RefObject<PopoverRootActions \| null> \| undefined` | A ref to imperative actions. - `unmount`: Manually unmounts the popover. Call this after any externally controlled closing animation finishes. - `close`: Closes the popover imperatively when called. |
| `children` | No | `React.ReactNode \| PayloadChildRenderFunction<Payload>` | The content of the popover. This can be a regular React node or a render function that receives the `payload` of the active trigger. |
| `defaultOpen` | No | `boolean \| undefined` | Whether the popover is initially open. To render a controlled popover, use the `open` prop instead. |
| `defaultTriggerId` | No | `string \| null \| undefined` | ID of the trigger that the popover is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open popover. |
| `handle` | No | `PopoverHandle<Payload> \| undefined` | A handle to associate the popover with a trigger. If specified, allows external triggers to control the popover's open state. |
| `modal` | No | `boolean \| "trap-focus" \| undefined` | Determines if the popover enters a modal state when open. - `true`: user interaction is limited to the popover: document page scroll is locked, and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed. - `'trap-focus'`: focus is trapped inside the popover, but document page scroll is not locked and pointer interactions outside of it remain enabled. On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. When `modal` is `true`, focus trapping is enabled only if `<Popover.Close>` is rendered inside `<Popover.Popup>`. It can be visually hidden with your own CSS if needed, such as Tailwind's `sr-only` utility. When `modal` is `'trap-focus'`, render `<Popover.Close>` inside `<Popover.Popup>` so touch screen readers can escape the popup. |
| `onOpenChange` | No | `((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) \| undefined` | Event handler called when the popover is opened or closed. |
| `onOpenChangeComplete` | No | `((open: boolean) => void) \| undefined` | Event handler called after any animations complete when the popover is opened or closed. |
| `open` | No | `boolean \| undefined` | Whether the popover is currently open. |
| `triggerId` | No | `string \| null \| undefined` | ID of the trigger that the popover is associated with. This is useful in conjunction with the `open` prop to create a controlled popover. There's no need to specify this prop when the popover is uncontrolled (that is, when the `open` prop is not set). |

### Popover.Trigger

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: import("@base-ui/react").PopoverTriggerState) => string \| undefined) \| undefined` | See the usage contract and declaration. |
| `closeDelay` | No | `number \| undefined` | See the usage contract and declaration. |
| `delay` | No | `number \| undefined` | See the usage contract and declaration. |
| `handle` | No | `Base.Handle<unknown> \| undefined` | See the usage contract and declaration. |
| `id` | No | `string \| undefined` | See the usage contract and declaration. |
| `nativeButton` | No | `boolean \| undefined` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `openOnHover` | No | `boolean \| undefined` | See the usage contract and declaration. |
| `payload` | No | `unknown` | See the usage contract and declaration. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps<any>, PopoverTriggerState> \| undefined` | See the usage contract and declaration. |
| `style` | No | `CSSProperties \| ((state: import("@base-ui/react").PopoverTriggerState) => React.CSSProperties \| undefined) \| undefined` | See the usage contract and declaration. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Positioner

| Property | Required | Type | Meaning |
|---|---|---|---|
| `align` | No | `Align \| undefined` | How to align the popup relative to the specified side. |
| `alignOffset` | No | `number \| OffsetFunction \| undefined` | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |
| `anchor` | No | `Element \| VirtualElement \| RefObject<Element \| null> \| (() => Element \| VirtualElement \| null) \| null \| undefined` | An element to position the popup against. By default, the popup will be positioned against the trigger. |
| `arrowPadding` | No | `number \| undefined` | Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. |
| `className` | No | `string \| ((state: PopoverPositionerState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `collisionAvoidance` | No | `CollisionAvoidance \| undefined` | Determines how to handle collisions when positioning the popup. `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`): - `'flip'`: keep the requested side when it fits; otherwise try the opposite side (`top` and `bottom`, or `left` and `right`). - `'shift'`: never change side; keep the requested side and move the popup within the clipping boundary so it stays visible. - `'none'`: do not correct side-axis overflow. `align` controls overflow on the alignment axis (`start`/`center`/`end`): - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows. - `'shift'`: keep side and requested alignment, then nudge the popup along the alignment axis to fit. - `'none'`: do not correct alignment-axis overflow. `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the preferred axis cannot fit: - `'start'`: allow perpendicular fallback and try the logical start side first (`top` before `bottom`, or `left` before `right` in LTR). - `'end'`: allow perpendicular fallback and try the logical end side first (`bottom` before `top`, or `right` before `left` in LTR). - `'none'`: do not fallback to the perpendicular axis. When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`. If `align` is omitted, it defaults to `'flip'`. |
| `collisionBoundary` | No | `Boundary \| undefined` | An element or a rectangle that delimits the area that the popup is confined to. |
| `collisionPadding` | No | `Padding \| undefined` | Additional space to maintain from the edge of the collision boundary. |
| `disableAnchorTracking` | No | `boolean \| undefined` | Whether to disable the popup from tracking any layout shift of its positioning anchor. |
| `positionMethod` | No | `"absolute" \| "fixed" \| undefined` | Determines which CSS `position` property to use. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverPositionerState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `side` | No | `Side \| undefined` | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. |
| `sideOffset` | No | `number \| OffsetFunction \| undefined` | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |
| `sticky` | No | `boolean \| undefined` | Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. |
| `style` | No | `CSSProperties \| ((state: PopoverPositionerState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Popup

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverPopupState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `finalFocus` | No | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => void \| boolean \| HTMLElement \| null) \| undefined` | Determines the element to focus when the popover is closed. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing. |
| `initialFocus` | No | `boolean \| RefObject<HTMLElement \| null> \| ((openType: InteractionType) => void \| boolean \| HTMLElement \| null) \| undefined` | Determines the element to focus when the popover is opened. By default, focus moves to the first tabbable element inside the popup, except when the popover is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (first tabbable element or popup). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverPopupState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverPopupState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Title

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverTitleState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverTitleState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverTitleState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Description

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverDescriptionState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverDescriptionState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverDescriptionState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Close

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverCloseState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `nativeButton` | No | `boolean \| undefined` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverCloseState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverCloseState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Arrow

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverArrowState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverArrowState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverArrowState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"popover", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### Popover.Portal

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: PopoverPortalState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `container` | No | `HTMLElement \| ShadowRoot \| RefObject<HTMLElement \| ShadowRoot \| null> \| null \| undefined` | A parent element to render the portal element into. |
| `keepMounted` | No | `boolean \| undefined` | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, PopoverPortalState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: PopoverPortalState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |

## Defaults and customization

Descriptor defaults: `{"size":"md","tone":"neutral"}`. Parts: `trigger`, `positioner`, `popup`, `title`, `description`, `close`, `arrow`. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

## State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

## Declaration authority

Generated from `packages/faye-ui/dist/overlays/popover.d.ts` after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. [React DOM attributes](https://react.dev/reference/react-dom/components/common) and [Base UI component contracts](https://base-ui.com/react/overview/quick-start) describe the inherited foundations.
