1. Reference
  2. Navigation

<bottom-navigation-bar>

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

Navigation
bottom-navigation-bar.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>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
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.
color
font_size Label font size
number
12.0
font_weight Label font weight
normal, bold
normal
height Bar height (80 with indicator="pill")
number
60.0
icon_size Icon size
number
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).
color
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.
number
6
padding Vertical,horizontal padding
string
6,8
ripple_size Ripple effect size
number
90.0
selected_color Color of selected tab
color
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.
style
unselected_color Color of unselected tabs
color
nav-unselected
variant dock: a floating capsule instead of the full-width bar; content scrolls behind and around it.
string

Readings

NameWhat 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

This page is also Markdown, and all of HAM is in llms.txt.