# <button>

A tappable button that runs an action: a fetch, a navigation or a statement.

Category: Forms and input.

```ham
<column style="gap-12">
    <button>Continue</button>
    <button style="bg-white text-primary border border-primary">Cancel</button>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `color` | Background/foreground color |  |
| `icon` | Icon name; with no text and no children the button is the icon alone |  |
| `size` | Button size preset (xs, sm, md, lg, xl) | `md` |
| `style` | Style classes (also parses size, variant, color as shorthand tokens) |  |
| `text` | Button label text (when no children; none with icon= alone) | `Button` |
| `variant` | Button style variant (elevated, filled, tonal, outlined, plain, text) | `elevated` |

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.

## Guides and recipes that use it

- [Your first screen](https://hypeapps.dev/docs/guides/first-screen.md)
- [Forms and state](https://hypeapps.dev/docs/guides/forms.md)
- [Data and databases](https://hypeapps.dev/docs/guides/data.md)
- [A poll that syncs](https://hypeapps.dev/docs/guides/sync.md)
- [Who's using the app ($me)](https://hypeapps.dev/docs/guides/me.md)
- [Gestures](https://hypeapps.dev/docs/guides/gestures.md)
- [Animations and effects](https://hypeapps.dev/docs/guides/animations.md)
- [Drawing and media](https://hypeapps.dev/docs/guides/media.md)
- [Your own tags](https://hypeapps.dev/docs/guides/own-tags.md)
- [A seat picker](https://hypeapps.dev/docs/cookbook/seat-picker.md)
- [A cart with quantities](https://hypeapps.dev/docs/cookbook/cart.md)
- [A chat thread](https://hypeapps.dev/docs/cookbook/chat.md)
- [Rows the server updates (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-watchlist.md)
- [Pick the right match (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-match.md)
- [Search on the server (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-search.md)

## 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.
- [`<checkbox>`](https://hypeapps.dev/docs/reference/checkbox.md): A checkbox with a label; its state goes into a variable by name.
- [`<chip>`](https://hypeapps.dev/docs/reference/chip.md): A compact chip: a label, a filter that toggles, a single choice in a set, or an action.
- [`<color-picker>`](https://hypeapps.dev/docs/reference/color-picker.md): A color picker: a hue ring round a disc, with swatches; the chosen color goes into a variable.
- [`<data-cell>`](https://hypeapps.dev/docs/reference/data-cell.md): One cell of a data table row.
- [`<data-column>`](https://hypeapps.dev/docs/reference/data-column.md): A column heading of a data table.
- [`<data-row>`](https://hypeapps.dev/docs/reference/data-row.md): One row of a data table, holding a data cell for each column.
- [`<data-table>`](https://hypeapps.dev/docs/reference/data-table.md): A table of rows and columns with a header; the HTML table tags write the same table.

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