1. Reference
  2. Navigation

<tab-bar>

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

Navigation
tab-bar.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>
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
background-color Tab bar background.
color
expand No inner scroll: the tab content flows in the parent scroll.
boolean
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.
number
indicator-color Tab indicator color.
color
label-color Active tab label color.
color
scrollable Scrollable tabs.
boolean
false
unselected-label-color Inactive tab label color.
color

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.

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