Menu bar

A React component in Beamline's Navigation category, in the free sample.

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.

Use it for

  • Editor-like apps with many commands: report builders, design tools, spreadsheets.

Not for

Anatomy

  • bar (takes its row's free width)
  • trigger per menu
  • plate
  • ⋯ for the menus with no room
  • surface
  • rows (shared MenuItem)

States

  • closed
  • one menu open (its trigger on the brighter plate)
  • trigger hovered or focused (the plate under it)
  • folded: the bar takes its row's free width; the menus it has no room for fold, last first, into ⋯, where each opens as a submenu, and come back as the room grows
  • item highlighted
  • check/radio on
  • disabled

Keyboard

  • ← → move between menus
  • ↓ / Enter opens
  • ↑ ↓ move in a menu
  • Escape closes and returns focus to the trigger
  • 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 trigger under the pointer or holding focus and glides to the next over --pui-duration-fast (GlidePlate); while a menu is open it sits a rung brighter under that menu's trigger, and it fades when the pointer leaves. A trigger press is acknowledged at once. Menus switch instantly once one is open. Each surface opens out of its trigger (_shared/overlay.module.css, source morph): the side next to the trigger is there at once so the nearest rows read within the ruled 90 ms, the far side settles by ~200 ms; it closes back into the trigger in 180 ms. Reduced motion: the plate jumps and surfaces fade.

Props

PropTypeDefaultDescription
labelstring—The bar's accessible name, e.g. "Report editor".
menus{ label: string; items: MenuItem[] }[]—File, Edit, View…: each a label and the same rows as DropdownMenu.
value / defaultValue / onValueChangestring—value: The open menu's label, controlled or uncontrolled; "" when none is open, "__beamline-more-menus__" while the ⋯ of a narrow bar is open. defaultValue: Initial id of the open menu when uncontrolled. Defaults to an empty string. onValueChange: Reports id of the open menu after an edit; no callback by default.
classNamesMenuClassNames—Classes for the named visual parts; no part overrides by default.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
valuestring—The open menu's label, controlled or uncontrolled; "" when none is open, "__beamline-more-menus__" while the ⋯ of a narrow bar is open.
defaultValuestring—Initial id of the open menu when uncontrolled. Defaults to an empty string.
onValueChange((value: string) => void)—Reports id of the open menu after an edit; no callback by default.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.
dir"ltr" | "rtl"—Reading direction; inherits the surrounding direction when omitted. Defaults to the surrounding reading direction.

Dependencies

@radix-ui/react-direction, @radix-ui/react-menubar, lucide-react

Import

import { Menubar } from "@beamline/menubar";

Get it

Menu bar is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Menu bar 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.
  • Navigation menu: A site or docs header whose sections open into one panel that resizes and slides between them; NavigationMenuCard is the standard link row.
  • 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.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.