1. Reference
  2. Navigation

<tab>

One pane of a tab bar: a label or icon in the bar, and content built the first time it is shown.

Navigation
tab.ham
<tab-bar label-color="teal-600"
         indicator-color="teal-600">
    <tab label="Upcoming"
         icon="event">
        <column style="p-16 gap-8">
            <text style="font-semibold">Jazz night at Blue Room</text>
            <text style="muted">Friday, 21:00</text>
        </column>
    </tab>
    <tab label="Past"
         icon="history">
        <text style="p-16">No past events</text>
    </tab>
</tab-bar>
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
icon Optional tab icon (supports active: prefix modifier)
string
label Tab label in TabBar
string

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.