# <snackbar>

A short message bar pinned to the bottom of the screen, with an optional action button.

Category: Overlays.

```ham
<column style="w-full gap-12">
    <text>Inbox</text>
    <snackbar message="Message archived"
              action-label="Undo"
              duration="10"/>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `behavior` | Floating above the bottom, or fixed to it. (floating, fixed) | `floating` |
| `close-icon` | Show a close icon. | `false` |
| `color` | Background color. |  |
| `duration` | How long it shows: seconds (3), or 3s / 3000ms. A bare number over 60 is read as milliseconds. | `4` |
| `message` (also `text`) | Snackbar message |  |

## Commands

| Name | What it does |
|---|---|
| `dismiss` | Close it. |
| `show` | Open it. |

## Events

| Name | What it does |
|---|---|
| `action-label` | Action button label |

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.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<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.
- [`<popover>`](https://hypeapps.dev/docs/reference/popover.md): Floats its children next to another element, like a reactions bar over a Like button.
- [`<popup-menu>`](https://hypeapps.dev/docs/reference/popup-menu.md): An icon button that opens a context menu; picking an item runs its action and fires select.

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