NavigationRail

fun TileSchemaBuilderScope.NavigationRail(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, selectedItemId: String, header: TileSchemaBuilderScope.() -> Unit? = null, footer: TileSchemaBuilderScope.() -> Unit? = null, items: NavigationRailItemSchemaBuilderScope.() -> Unit)

Renders a Material 3 navigation rail — the side-rail counterpart of NavigationBar — with one entry per item declared via items (built with addItem). An item is selected when its id equals selectedItemId; the selected item's icon is drawn in its filled variant, the others outlined, and its label is centered under the icon (or omitted when not given). header is rendered above the items and footer at the very bottom (pushed down by a weighted spacer so it hugs the bottom edge); both are optional, arbitrary tiles. Tapping an item flips selectedItemId locally on the client (no server round trip needed for the highlight to move) — tapping the already-selected item still fires everything again. The rail itself is not clickable and fires no display trigger; it only tracks the selected item, so performing the actual navigation is up to the events wired to the item clicks. Dispatches onNavigationRailItemClick(itemId) when an item is tapped, so events can be wired per item.

Parameters

id

Unique identifier of the tile. Defaults to a random id.

events

Events owned by this tile, wired to its triggers (e.g. onNavigationRailItemClick).

style

Layout/appearance modifiers (size, padding, background, etc).

visibility

Whether the tile is shown, hidden but occupies space, or removed from layout. Defaults to visible.

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

selectedItemId

Id of the currently selected item.

header

Tile rendered in the rail's header slot, above the items. Defaults to none.

footer

Tile rendered at the bottom of the rail. Defaults to none.

items

Rail entries, declared with addItem.