Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Menubar

A row of menus, as a desktop application has at the top of its window.

Built on the headless Menubar.See its API in Docs

Rendered by React 19.3.1

menubar.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/menubar.json

It also adds utils, dropdown-menu. The app needs its setup first: Installation.

Usage

Menubar holds a MenubarMenu per menu, each with MenubarTrigger and MenubarContent. The content takes the same items as a Dropdown Menu, with the Menubar prefix: MenubarItem, MenubarCheckboxItem, MenubarRadioGroup and MenubarRadioItem, MenubarGroup, MenubarLabel, MenubarSeparator, MenubarShortcut and MenubarSub with its trigger and content. In Angular the template writes uiMenubarPortal around each content. Moving between menus with the arrow keys, and opening the next one on hover once a menu is open, come from the headless Menubar.

import {
  Menubar,
  MenubarCheckboxItem,
  MenubarContent,
  MenubarGroup,
  MenubarItem,
  MenubarLabel,
  MenubarMenu,
  MenubarPortal,
  MenubarRadioGroup,
  MenubarRadioItem,
  MenubarSeparator,
  MenubarShortcut,
  MenubarSub,
  MenubarSubContent,
  MenubarSubTrigger,
  MenubarTrigger,
} from '@/components/ui/menubar'

Examples

Default

File, Edit, View and Profiles menus with shortcuts, submenus and checks.

Its preview and code are at the top of the page.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Menubar's API reference.