> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Popover

> A floating panel anchored to a trigger for free-form content, built from Popover, PopoverTrigger, PopoverContent, PopoverAnchor and PopoverClose.

```tsx theme={null}
import {
  Popover,
  PopoverAnchor,
  PopoverClose,
  PopoverContent,
  PopoverTrigger,
} from "@fanvue/ui";
import type {
  PopoverAnchorProps,
  PopoverCloseProps,
  PopoverContentBaseProps,
  PopoverContentName,
  PopoverContentProps,
  PopoverProps,
  PopoverTriggerProps,
} from "@fanvue/ui";
```

## Examples

## Default

[Popover — Default](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-popover--default\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Button, Popover, PopoverClose, PopoverContent, PopoverTrigger } from "@fanvue/ui";

<Popover>
  <PopoverTrigger asChild>
    <Button variant="secondary">Open popover</Button>
  </PopoverTrigger>
  <PopoverContent aria-label="Example">
    <div className="typography-body-small-14px-regular flex w-64 flex-col gap-2 p-2">
      <p>Any content can sit inside a popover.</p>
      <PopoverClose asChild>
        <Button variant="secondary" size="32">
          Close
        </Button>
      </PopoverClose>
    </div>
  </PopoverContent>
</Popover>
```

## Open

[Popover — Open](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-popover--open\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Button, Popover, PopoverClose, PopoverContent, PopoverTrigger } from "@fanvue/ui";

<Popover defaultOpen>
  <PopoverTrigger asChild>
    <Button variant="secondary">Open popover</Button>
  </PopoverTrigger>
  <PopoverContent aria-label="Example" onOpenAutoFocus={(event) => event.preventDefault()}>
    <div className="typography-body-small-14px-regular flex w-64 flex-col gap-2 p-2">
      <p>Any content can sit inside a popover.</p>
      <PopoverClose asChild>
        <Button variant="secondary" size="32">
          Close
        </Button>
      </PopoverClose>
    </div>
  </PopoverContent>
</Popover>
```

## With Toolbar Action

[Popover — With Toolbar Action](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-popover--with-toolbar-action\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Popover, PopoverContent, PopoverTrigger, TableToolbarAction } from "@fanvue/ui";

<Popover>
  <PopoverTrigger asChild>
    <TableToolbarAction>Filters</TableToolbarAction>
  </PopoverTrigger>
  <PopoverContent aria-label="Filters">
    <p className="typography-body-small-14px-regular w-64 p-2">Filter options go here.</p>
  </PopoverContent>
</Popover>
```

## Props

## Popover

Root of a popover. Holds the open state shared by its trigger and content.

A direct re-export of the Radix `PopoverPrimitive.Root` primitive. It accepts all of that primitive's props, unchanged.

## PopoverAnchor

Optional element the content positions against instead of the trigger.

A direct re-export of the Radix `PopoverPrimitive.Anchor` primitive. It accepts all of that primitive's props, unchanged.

## PopoverClose

Element that closes the popover when activated. Use `asChild` to render your own button.

A direct re-export of the Radix `PopoverPrimitive.Close` primitive. It accepts all of that primitive's props, unchanged.

## PopoverContent

Floating panel rendered in a portal, styled like the `DropdownMenuContent` surface. Focus moves into it on open and returns to the trigger on close. It renders a `role="dialog"`, so pass `aria-label` or `aria-labelledby` to name it. The content unmounts when closed; `forceMount` is not supported.

**align** `"center" | "end" | "start"` (default: start)

Alignment of the content against the trigger.

**asChild** `boolean`

**className** `string`

Additional CSS classes merged onto the content surface.

**collisionPadding** `number | Partial\<Record\<"top" | "bottom" | "left" | "right", number\>\>` (default: 16)

Distance in pixels kept between the content and the viewport edge, as a number or a per-side object.

**sideOffset** `number` (default: 8)

Distance in pixels between the trigger and the content.

## PopoverTrigger

Element that toggles the popover. Use `asChild` to render your own button.

On touch and pen, a press-and-release that moves past a small threshold counts as a drag, and the synthetic click that follows it is ignored, so scrolling past the trigger does not open it.

**asChild** `boolean`

## Exported types

Also exported from `@fanvue/ui`: `PopoverAnchorProps`, `PopoverCloseProps`, `PopoverContentBaseProps`, `PopoverContentName`, `PopoverContentProps`, `PopoverProps`, `PopoverTriggerProps`.

***

**Setup:** [Installation](https://api.fanvue.com/docs/ui/installation.md) · [Theming](https://api.fanvue.com/docs/ui/theming.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.