# Tooltip

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

A hover tooltip that wraps any trigger element. The `content` string is
shown in a floating popover when the user hovers over the child.

```python
from refast.components import Tooltip, Button

Tooltip(
    content="This action cannot be undone.",
    children=[Button("Delete", variant="destructive")],
)
```

```python
Tooltip(
    content="This is a helpful tooltip.",
    side="top",
    children=[Button("Hover over me")],
)
```

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `content` | `str` | *(required)* | Plain-text tooltip message. |
| `children` | `list` | `[]` | The trigger element(s). Typically a single component. |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"top"` | Preferred side of the trigger to display the tooltip. |
| `side_offset` | `int \| None` | `None` | Pixel gap between the trigger and the tooltip. |
| `class_name` | `str` | `""` | Extra Tailwind classes applied to the tooltip content. |

## All sides

```python
Row(gap=4, children=[
    Tooltip(content="Top",    side="top",    children=[Button("Top")]),
    Tooltip(content="Right",  side="right",  children=[Button("Right")]),
    Tooltip(content="Bottom", side="bottom", children=[Button("Bottom")]),
    Tooltip(content="Left",   side="left",   children=[Button("Left")]),
])
```

## With icon button

```python
Tooltip(
    content="Open settings",
    side="right",
    children=[IconButton(icon="settings", variant="ghost")],
)
```

## With custom offset

```python
Tooltip(
    content="Saved!",
    side="top",
    side_offset=8,
    children=[Button("Save", icon="save")],
)
```

---

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).
