# <tab>

One pane of a tab bar: a label or icon in the bar, and content built the first time it is shown.

Category: Navigation.

```ham
<tab-bar label-color="teal-600"
         indicator-color="teal-600">
    <tab label="Upcoming"
         icon="event">
        <column style="p-16 gap-8">
            <text style="font-semibold">Jazz night at Blue Room</text>
            <text style="muted">Friday, 21:00</text>
        </column>
    </tab>
    <tab label="Past"
         icon="history">
        <text style="p-16">No past events</text>
    </tab>
</tab-bar>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `icon` | Optional tab icon (supports active: prefix modifier) |  |
| `label` | Tab label in TabBar |  |

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

- [`<tab-bar>`](https://hypeapps.dev/docs/reference/tab-bar.md): A Material tab bar with swipeable panes; each <tab> child is a label and its content.
- [`<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-nav-item>`](https://hypeapps.dev/docs/reference/bottom-nav-item.md): One item of a bottom navigation bar: an icon and label that load a page or run a statement.
- [`<bottom-navigation-bar>`](https://hypeapps.dev/docs/reference/bottom-navigation-bar.md): The tab bar along the bottom of a screen; each item swaps a page into the main area.
- [`<nav-item>`](https://hypeapps.dev/docs/reference/nav-item.md): The older spelling of a bottom navigation item: metadata the bar reads, not drawn by itself.
- [`<navigation-rail>`](https://hypeapps.dev/docs/reference/navigation-rail.md): A vertical bar of destinations down the side of the screen, each with its own content panel.
- [`<portal>`](https://hypeapps.dev/docs/reference/portal.md): A live window onto another page: blurred and dimmed under a glass rim, it opens to full screen on a tap.

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