1. Reference
  2. Navigation

<navigation-rail>

A vertical bar of destinations down the side of the screen, each with its own content panel.

Navigation
navigation-rail.ham
<screen>
    <main>
        <navigation-rail color="indigo"
                         label-type="all"
                         height="560">
            <rail-item icon="inbox"
                       label="Inbox">
                <column style="p-16 gap-8">
                    <text style="font-bold">Inbox</text>
                    <text>Sam: Lunch tomorrow?</text>
                    <text>Ana: Slides attached</text>
                </column>
            </rail-item>
            <rail-item icon="star"
                       label="Starred">
                <text>Starred</text>
            </rail-item>
            <rail-item icon="settings"
                       label="Settings">
                <text>Settings</text>
            </rail-item>
        </navigation-rail>
    </main>
</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 Rail background.
color
color Selected indicator color.
color
extended Extended mode (labels beside the icons).
boolean
false
height Total height in px.
number
label-type Which items show labels.
all, selected, none
all
selected Initially selected index.
number
0

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.