navigation · conformant
NavigationRail
NavigationRailNavigationRailProps
import { FloatingActionButton, Icon, NavigationRail, Surface, Text } from '@language-lit/material3-expressive'
export function NavigationRailExample() {
return (
<Surface
as="section"
aria-labelledby="navigation-rail-example-title"
color="surface-container-low"
shape="extra-large"
className="navigation-rail-example"
>
<Text as="h2" id="navigation-rail-example-title" variant="titleLarge" emphasis="emphasized">
Navigation rail
</Text>
<Text as="p" variant="bodyMedium">
The same item language as Navigation bar, oriented vertically, with
an optional header slot.
</Text>
<div className="navigation-rail-example__frame">
<NavigationRail
aria-label="Example sections"
header={<FloatingActionButton aria-label="Compose" icon={<Icon source="add" />} size="medium" />}
items={[
{
value: 'home',
label: 'Home',
icon: <Icon source="home" />,
selectedIcon: <Icon source="home" fill={1} />,
},
{ value: 'favorites', label: 'Favorites', icon: <Icon source="favorite" /> },
{ value: 'trash', label: 'Trash', icon: <Icon source="delete" />, disabled: true },
{ value: 'docs', label: 'Docs', icon: <Icon source="description" />, href: '#' },
]}
/>
</div>
<Text as="p" variant="labelLarge">
Without a header
</Text>
<div className="navigation-rail-example__frame">
<NavigationRail
aria-label="Example sections without header"
items={[
{ value: 'home', label: 'Home', icon: <Icon source="home" /> },
{ value: 'favorites', label: 'Favorites', icon: <Icon source="favorite" /> },
{ value: 'trash', label: 'Trash', icon: <Icon source="delete" />, disabled: true },
]}
/>
</div>
</Surface>
)
}NavigationRail is NavigationBar's vertical sibling: the same item
language (fixed-size icon, width-expanding pill, label) laid out in a fixed-width side
column, with an optional header region above the items.
import { FloatingActionButton, Icon, NavigationRail } from '@language-lit/material3-expressive'
import '@language-lit/material3-expressive/styles.css'
<NavigationRail
aria-label="Primary sections"
header={<FloatingActionButton aria-label="Compose" icon={<Icon source="add" />} size="medium" />}
items={[
{ value: 'home', label: 'Home', icon: <Icon source="home" /> },
{ value: 'favorites', label: 'Favorites', icon: <Icon source="favorite" /> },
]}
/>Contract
items,value/defaultValue/onValueChangeare identical toNavigationBar's own contract — see its documentation for the fullNavigationItemshape and link-safehrefbehavior.headeris a consumer-owned region rendered above the items, typically aFloatingActionButtonor menu button, matching the pinned source's ownheaderslot.- Selection keeps the icon in its 24×24px box and expands only the centered
indicator background from zero width to 56×32px, matching
NavigationBar.
Tokens and boundaries
All color, geometry, and motion values live in one
--m3e-comp-navigation-rail-* registration. Theme overrides remain scoped
to Material3Provider; NavigationRail injects no runtime styles. It
imports no Next.js, Vite, router, animation library, or
private application code.