# Popover

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/popover
- **Markdown:** https://refast.fastapicloud.dev/docs/components/popover.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/feedback/popover.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

Displays rich content in a floating panel, triggered by a button.
Unlike a tooltip, a popover can contain interactive elements.

```python
from refast.components import Popover, PopoverTrigger, PopoverContent
```

```python
Popover(
    side="bottom",
    align="center",
    children=[
        PopoverTrigger(children=[Button("Open Popover")]),
        PopoverContent(
            side="bottom",
            align="center",
            children=[...],
        ),
    ]
)
```

## Props

### `Popover`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `open` | `bool \| None` | `None` | Controlled open state |
| `default_open` | `bool` | `False` | Initial open state |
| `on_open_change` | `Callback \| None` | `None` | Called when open state changes |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Preferred side |
| `align` | `"start" \| "center" \| "end"` | `"center"` | Content alignment |
| `trigger` | `Component \| None` | `None` | Shorthand trigger component |

### `PopoverContent`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Preferred side |
| `side_offset` | `int` | `4` | Pixels from the trigger |
| `align` | `"start" \| "center" \| "end"` | `"center"` | Alignment relative to trigger |

## Component Hierarchy

```
Popover
├── PopoverTrigger   ← button that opens the panel
└── PopoverContent   ← floating panel content
```

## Example — Settings Popover

```python
Popover(
    children=[
        PopoverTrigger(children=[IconButton(icon="settings")]),
        PopoverContent(
            side="bottom",
            align="end",
            children=[
                Heading("Display settings", level=4),
                Separator(class_name="my-2"),
                Row([Label("Theme"), Select(options=[...])]),
                Row([Label("Font size"), Select(options=[...])]),
            ]
        ),
    ]
)
```

## Shorthand with `trigger`

```python
Popover(
    trigger=Button("Options"),
    side="bottom",
    align="start",
    children=[
        PopoverContent(children=[...]),
    ]
)
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
