<navigation-rail>
A vertical bar of destinations down the side of the screen, each with its own content panel.
<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>
Attributes
| Name | What it does | Default |
|---|---|---|
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
| Name | What 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.