# <bottom-navigation-bar>

The tab bar along the bottom of a screen; each item swaps a page into the main area.

Category: Navigation.

```ham
<screen>
    <main>
        <column style="w-full p-16 gap-8">
            <text style="font-bold">Search</text>
            <text style="muted">Find books, authors and libraries.</text>
        </column>
    </main>
    <bottom-navigation-bar indicator="pill"
                           selected_color="teal">
        <bottom-nav-item label="Search"
                         icon="search"
                         selected="true"
                         action="$tab = 'search'"/>
        <bottom-nav-item label="Libraries"
                         icon="account_balance"
                         action="$tab = 'libraries'"/>
        <bottom-nav-item label="Saved"
                         icon="bookmark"
                         action="$tab = 'saved'"/>
    </bottom-navigation-bar>
</screen>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `alignment` | Tab alignment. A dock defaults to hug (as wide as its items); when the items would not fit the screen, the capsule takes the screen's width and the items share it equally instead of overflowing (spaceEvenly, spaceAround, spaceBetween, center, start, end) | `spaceEvenly` |
| `background_color` (also `bg_color`, `bg-color`, `background-color`) | Bar background color. |  |
| `font_size` | Label font size | `12.0` |
| `font_weight` | Label font weight (normal, bold) | `normal` |
| `height` | Bar height (80 with indicator="pill") | `60.0` |
| `icon_size` | Icon size | `24.0` |
| `indicator` | pill: Material 3's pill (64 × 32) behind the selected item's icon; it follows the selection. (pill) |  |
| `indicator-color` | The pill's color (default: the selected color, faint). |  |
| `labels` | Which item labels are drawn: all, only the selected one, or none (icon-only). A hidden label stays the item's accessibility name. (all, selected, none) | `all` |
| `notch` | circle: the bar's top edge rises in an arc around the raised item, in the bar's bg-* and top-border colors. (circle) |  |
| `notch-margin` (also `notch_margin`) | Gap in px between the raised circle and the arc. | `6` |
| `padding` | Vertical,horizontal padding | `6,8` |
| `ripple_size` | Ripple effect size | `90.0` |
| `selected_color` | Color of selected tab | `primary` |
| `style` | Full-width bar: paints the bar itself (bg-*, border-*, shadow-*, glass-*) through the home-indicator strip, replacing the default frosted surface. Dock: the capsule's look. |  |
| `unselected_color` | Color of unselected tabs | `nav-unselected` |
| `variant` | dock: a floating capsule instead of the full-width bar; content scrolls behind and around it. |  |

## 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.

## Guides and recipes that use it

- [Navigation](https://hypeapps.dev/docs/guides/navigation.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.
- [`<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.
- [`<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.
- [`<rail-item>`](https://hypeapps.dev/docs/reference/rail-item.md): One destination in a navigation rail: an icon, a label and the content shown when it is picked.
- [`<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.

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