Navigation menu
A React component in Beamline's Navigation category, in the free sample.
A site or docs header whose sections open into one panel that resizes and slides between them; NavigationMenuCard is the standard link row.
Use it for
- Marketing, docs or portal headers with grouped links.
Not for
- In-app navigation (sidebar).
Anatomy
- NavigationMenu (takes its row's free width; a size container)
- NavigationMenuList (the travelling plate; scrolls when too narrow)
- NavigationMenuItem
- NavigationMenuTrigger
- NavigationMenuContent
- NavigationMenuLink
- NavigationMenuCard (icon on an m-tag tile, title, one line)
- viewport (built in, m-overlay)
States
- closed
- open (the plate under the trigger, chevron turned)
- switching section (the plate and the panel travel)
- active link (ink plus a short accent rule under the label; a panel card is tinted with an inline-start edge)
- narrow room (a size container): the row scrolls sideways with an edge fade where more sections wait; under 30rem the panel hangs from the header's end and stays inside the screen
Keyboard
- ← → between sections
- ↓ / Enter opens
- Tab through the panel
- Escape closes
- Direction follows explicit props or the managed scope and resolves the surrounding static direction; forwarded refs keep internal direction measurement attached. refreshAppearance updates static scope changes without remounting controls.
Motion
One plate lights the section under the pointer or holding focus and glides to the next over --pui-duration-fast; with the pointer in a panel it rests under that panel's section and it fades when nothing is open. The panel resizes over 200 ms while sections slide 24 px from the side the pointer came from. A press is acknowledged at once. The current page's rule in the row is one line that travels to the next current section (the shared glide: the edge on its way leads). Reduced motion: the plate jumps, the panel still resizes.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue / onValueChange | string | — | value: Controlled selected value; omit to use defaultValue. defaultValue: Initial selection when uncontrolled; omitted by default. onValueChange: Reports the selected value after a change; no callback by default. |
NavigationMenuCard | { href, title, description?, icon?, active? } | — | A destination card inside the menu: href and title are required; description, icon and active are optional. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
classNames | NavigationMenuClassNames / NavigationMenuTriggerClassNames / NavigationMenuCardClassNames | — | Classes for the named visual parts; no part overrides by default. |
NavigationMenuCard.href (required) | string | — | On NavigationMenuCard: URL opened when the item is activated. Required. |
NavigationMenuCard.title (required) | ReactNode | — | On NavigationMenuCard: Heading shown above the content. Required. |
NavigationMenuCard.description | ReactNode | — | On NavigationMenuCard: Supporting text beneath the label or heading. Defaults to no supporting text. |
NavigationMenuCard.icon | ReactNode | — | On NavigationMenuCard: Icon element shown beside the label. Defaults to no leading icon. |
NavigationMenuCard.active | boolean | — | On NavigationMenuCard: Whether this navigation item is the current page. Defaults to false. |
NavigationMenuCard.className | string | — | On NavigationMenuCard: Classes on the documented visual root; no override by default. |
Dependencies
@radix-ui/react-direction, @radix-ui/react-navigation-menu, lucide-react
Import
import { NavigationMenu, NavigationMenuList, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuCard } from "@beamline/navigation-menu";
Get it
Navigation menu is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Navigation menu is included in the free MIT sample. Get Beamline · Connect your agent
More in Navigation
- Sidebar: The app's main navigation: sections, items with counts and one level of sub-pages, an icon rail with tooltips (⌘B, the trigger or the edge), and a sheet…
- Tree view: Nested folders and records with the full tree keyboard model (arrows, Home/End, *, type to jump), depth guides, counts and animated opening.
- Stepper: Where someone is in a multi-step flow: done steps carry a check, the current one a ring, and the line between marks fills as steps complete.
- Table of contents: The sections of a long page beside it, with the one being read marked as you scroll: the marker travels down the rail between sections, the rail fills…
- Tabs: Switches between panels of one object; one indicator slides to the active tab, counts sit beside labels, and the tabs a row has no room for fold into More.
- Menu bar: A desktop-style File / Edit / View bar for editor-like apps; each menu takes the same rows as the dropdown menu, and pointing moves between open menus.
- Pagination: Moves through pages of a known length: first, last and the current page's neighbours, with an optional “41–60 of 468”. It answers to its own room…
- User menu: The account menu behind the avatar: who is signed in, status, theme, account pages and sign out with progress; a bottom sheet on phones.
- Breadcrumb: Where a page sits and the way back up; it shows as many levels as its room holds and folds the ones nearest the top into a menu.