# <tab-bar>

A Material tab bar with swipeable panes; each <tab> child is a label and its content.

Category: Navigation.

```ham
<screen>
    <app-bar title="Library"/>
    <tab-bar label-color="teal-600"
             indicator-color="teal-600">
        <tab label="Books">
            <column style="p-16 gap-8">
                <text style="font-semibold">The Overstory</text>
                <text style="muted">Richard Powers, 62% read</text>
            </column>
        </tab>
        <tab label="Audiobooks">
            <text style="p-16">2 audiobooks</text>
        </tab>
        <tab label="Podcasts">
            <text style="p-16">5 shows</text>
        </tab>
    </tab-bar>
</screen>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `background-color` | Tab bar background. |  |
| `expand` | No inner scroll: the tab content flows in the parent scroll. | `false` |
| `height` | Total height in px. Below the Material intrinsic (48, or 74 with icons) it sizes the bar strip itself; larger values size bar plus views. |  |
| `indicator-color` | Tab indicator color. |  |
| `label-color` | Active tab label color. |  |
| `scrollable` | Scrollable tabs. | `false` |
| `unselected-label-color` | Inactive tab label color. |  |

## Readings

| Name | What it does |
|---|---|
| `index` | The selected item's position, from 0. |
| `label` | The selected item's 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

- [`<app-bar>`](https://hypeapps.dev/docs/reference/app-bar.md): The bar at the top of a screen: a title, a leading menu icon, and action icons on the right.
- [`<tab>`](https://hypeapps.dev/docs/reference/tab.md): One pane of a tab bar: a label or icon in the bar, and content built the first time it is shown.
- [`<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.

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