Navigation bar
Expressive3–5 destinations along the bottom of compact and medium windows, stacked or inline.
import { NavigationBar, NavigationBarItem } from '@windmorph/react';Purpose
The flexible navigation bar holds 3–5 top-level destinations along the bottom of compact and medium windows. With iconPlacement="top" (the default) items stack the icon above the label; with iconPlacement="start" the icon sits beside the label in a pill, for the flexible bar in medium windows. For larger windows use a NavigationRail instead.
Items are links (href) or buttons (onPress) with an icon, an optional currentIcon and a label; current marks the current one, its label keeping its weight (M3 Expressive). Stacked items share the width equally; arrangement="centered" groups them within side padding. Items beside their icons keep their own width and are centred by default, with the extra space at the bar's ends; when their labels don't fit on one line side by side (a narrow bar, or text at up to 2× its size), they stack and share the width equally instead, so every label stays whole. A long label wraps between words and the bar grows taller. A single word too long for its item may break only where the browser hyphenates it for the page's lang; it never breaks bare, and a line it still overflows ends with an ellipsis. The accessible name is always the full label.
An item's badge (a Badge) overlaps its icon. onReselect runs when the current destination is pressed again; M3 resets the page's scroll position to the top then. scrollBehavior="hide-on-scroll" slides the bar off the bottom while the page scrolls down and back on any scroll up, settling shown or hidden when the scroll stops; the bar becomes sticky, so put it last in the scrolling layout, and pass scrollRef when an element scrolls rather than the page. It stays put under reduced motion. Don't hide the bar on scroll when a screen reader is active.
Do and don't
When not to use
For more than five destinations use a Navigation rail.
See also
- Navigation bar on m3.material.io: Material's own guidelines, with anatomy and specs.
- Navigation rail: Top-level destinations along the start edge, collapsed or expanded, in medium windows.
- Tabs: Primary and secondary tab rows with a sliding indicator, scrollable when they overflow.