# <popover>

Floats its children next to another element, like a reactions bar over a Like button.

Category: Overlays.

```ham
<column style="items-center w-full pt-80">
    <button id="like"
            icon="thumb_up"
            action-longpress="#reactions.open">Like</button>
    <popover id="reactions"
             anchor="#like"
             open="true"
             arrow="true"
             style="bg-white dark:bg-gray-800 rounded-full p-8 shadow-lg">
        <row style="gap-12">
            <icon name="favorite fill red size-32"/>
            <icon name="sentiment_very_satisfied size-32 amber"/>
            <icon name="celebration size-32 purple"/>
        </row>
    </popover>
</column>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/popover-light.webp), [dark](https://hypeapps.dev/img/tags/popover-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `anchor` | The id of the element it points at (#like or like). Without one, where the popover is written. |  |
| `arrow` | A small triangle in the box's color pointing at the anchor. | `false` |
| `dismiss` | outside: a tap anywhere else closes it (and is not passed on). none: only #id.close does. (outside, none) | `outside` |
| `gap` | Space between the anchor and the box (and its arrow), px. | `8` |
| `open` | Open when it first shows. | `false` |
| `placement` | Which side of the anchor. With no room there it opens on the other side; it is kept on screen. (top, bottom, left, right) | `top` |

## Commands

| Name | What it does |
|---|---|
| `close` | Hide it. |
| `open` | Show it next to its anchor ($id.open becomes true). |
| `toggle` | Open it when closed, close it when open. |

## Readings

| Name | What it does |
|---|---|
| `open` | Whether it is showing. |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<button>`](https://hypeapps.dev/docs/reference/button.md): A tappable button that runs an action: a fetch, a navigation or a statement.
- [`<row>`](https://hypeapps.dev/docs/reference/row.md): Lays children side by side in one line; flex= shares the free space and align/cross position them.
- [`<icon>`](https://hypeapps.dev/docs/reference/icon.md): A Material Symbols icon, with its style, weight, size and color set in its name.
- [`<bottom-sheet>`](https://hypeapps.dev/docs/reference/bottom-sheet.md): A sheet that slides up from the bottom of the screen, with a drag handle and a title.
- [`<dialog>`](https://hypeapps.dev/docs/reference/dialog.md): A dialog with a title, a message, and confirm and cancel buttons that run statements.
- [`<dropdown>`](https://hypeapps.dev/docs/reference/dropdown.md): A Material dropdown menu: a field that opens a list of choices; the chosen value is readable by id.
- [`<menu-item>`](https://hypeapps.dev/docs/reference/menu-item.md): One choice in a popup menu or dropdown: an icon, a label, and the action it runs.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
