Components

Menubar

An animated React menubar built on shadcn/ui and Radix: the drop-in Menubar gives you desktop-app menus with sub-menus, checkbox and radio items and keyboard shortcuts, plus a Motion menubar block whose highlight glides between File, Edit and View while menus fade open.

  • Drop-in shadcn API
  • Radix Menubar
  • Sub-menus
  • Checkbox & radio items
  • Motion block

Installation

$ npx shadcn@latest add https://duskui.com/r/menubar.json

Adds components/ui/menubar.tsx with the shadcn exports and props (including inset and variant="destructive" on items). Animations are CSS (tw-animate-css), so the base needs no Motion.

Usage

app-menubar.tsx
import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarSeparator,
  MenubarShortcut,
  MenubarTrigger,
} from "@/components/ui/menubar"

export function AppMenubar() {
  return (
    <Menubar>
      <MenubarMenu>
        <MenubarTrigger>File</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>
            New tab <MenubarShortcut>⌘T</MenubarShortcut>
          </MenubarItem>
          <MenubarSeparator />
          <MenubarItem>Print…</MenubarItem>
        </MenubarContent>
      </MenubarMenu>
    </Menubar>
  )
}

Examples

Default

Menus with shortcuts, a disabled item, a sub-menu and a destructive action. Once a menu is open, hovering another trigger switches to it, and the left / right arrow keys move between menus.

Checkbox and radio items

MenubarCheckboxItem toggles view options and MenubarRadioGroup picks one value. Indicators fade in when an item turns on.

minimap · line numbers — dusk at 100%

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Animated Menubar

A desktop-app style menubar. A highlight glides between top-level triggers as you hover or arrow across them and follows the open menu as you sweep from menu to menu (a shared layoutId). Menus open from their trigger, items cascade in and a pill glides between items. Check marks scale in, and sub-menus use the DuskUI MenubarSubContent.

$ npx shadcn@latest add https://duskui.com/r/animated-menubar.json
PropTypeDefaultDescription
value / defaultValue / onValueChangestring""On AnimatedMenubar: the open menu's value, "" when closed.
valuestring—On AnimatedMenubarMenu: identifies the menu. Generated when omitted.
staggernumber0.025On AnimatedMenubarContent: delay between items cascading in, in seconds.
iconReactNode—On AnimatedMenubarItem / SubTrigger: leading icon; turns mint under the pill.
shortcutReactNode—On items: trailing keyboard hint. Visual only.
variant"default" | "destructive""default"On AnimatedMenubarItem: tints the item and its pill red.
checked / onCheckedChangeboolean / (checked: boolean) => void—On AnimatedMenubarCheckboxItem.
Label / Separator / Group / Sub / SubTrigger / SubContentRadix Menubar parts—Animated equivalents; Separator draws in from the left.

API Reference

Same parts as shadcn/ui: Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarLabel, MenubarSeparator, MenubarShortcut, MenubarGroup, MenubarPortal, MenubarSub, MenubarSubTrigger and MenubarSubContent, each forwarding its Radix props.

PropTypeDefaultDescription
value / defaultValue / onValueChangestring—On Menubar: the open menu (controlled or not).
loopbooleantrueOn Menubar: arrow keys wrap from the last trigger to the first.
align / alignOffset / sideOffset"start" | "center" | "end" / number / number"start" / -4 / 8On MenubarContent: placement under the trigger.
insetbooleanfalseOn items, labels and sub-triggers: indent to line up with indicators.
variant"default" | "destructive""default"On MenubarItem: tints the item red.
checked / onCheckedChangeboolean | "indeterminate"—On MenubarCheckboxItem.
value / onValueChangestring—On MenubarRadioGroup: the selected radio item.

Accessibility

  • Built on Radix Menubar: role="menubar" with roving focus; left / right arrows move between menus, Enter, Space or ↓ open one, Escape closes it and returns focus to its trigger.
  • Items support typeahead, Home / End and arrow keys; checkbox and radio items expose aria-checked.
  • Shortcuts are visual hints only (MenubarShortcut) — wire the actual key handlers yourself.
  • Under prefers-reduced-motion menus only fade; in the Motion block the gliding highlights jump instead of sliding.