1. Reference
  2. Navigation

<bottom-nav-item>

One item of a bottom navigation bar: an icon and label that load a page or run a statement.

Navigation
bottom-nav-item.ham
<screen>
    <main>
        <column style="w-full p-16 gap-8">
            <text style="font-bold">Home</text>
            <text style="muted">Three new books on your shelf.</text>
        </column>
    </main>
    <bottom-navigation-bar selected_color="teal">
        <bottom-nav-item label="Home"
                         icon="home"
                         selected="true"
                         action="$tab = 'home'"/>
        <bottom-nav-item label="Shelf"
                         icon="book"
                         badge="3"
                         action="$tab = 'shelf'"/>
        <bottom-nav-item label="Profile"
                         icon="person"
                         action="$tab = 'me'"/>
    </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
active-icon
also active_icon
Symbol shown while the item is selected (an outline/filled pair that is not one symbol's fill axis).
string
active-label-format Label shown while selected; %s is replaced by the label.
string
badge Count pill on the icon; hidden when empty, 0 or false. Interpolates, so badge="$db.loan.loans" stays live.
string
badge-color
also badge_color
Badge pill color (default red).
color
font_size Label font size
number
12.0
font_weight Label font weight
normal, bold
normal
icon Icon name (supports active: prefix modifier)
string
help
icon-image Image used as the icon instead of a Material Symbol.
url
icon-tint false keeps icon-image's own colors instead of tinting it.
boolean
true
icon_size Icon size
number
24.0
indicator-color This item's pill color, over the bar's indicator-color.
color
label Tab label
string
label-style Style tokens for the label text.
style
labels Per-item override of the bar's labels=.
all, selected, none
lift How far a raised item's circle rises above the bar's top edge, exactly, in pt (the notch deepens with it).
number
20
overflow Text overflow behavior
fade, ellipsis, clip
fade
pad_h Horizontal padding
number
8.0
pad_v Vertical padding
number
6.0
raised A lifted, filled circle: the center action item. The bar grows by lift and the strip above other items lets taps through.
boolean
raised-color Fill of the raised circle (default the bar's selected_color).
color
raised-icon-color Icon color on the raised circle.
color
white
raised-size Diameter of the raised circle.
number
56
raised-style
also raised_style
Style tokens for the raised circle (gradient-*, bg-*, border-*, shadow-*); it stays round and sized by raised-size.
string
selected Initially selected tab
boolean
false
selected_color Selected state color
color
inherit
unselected_color Unselected state color
color
inherit

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.