Menubar

Desktop-app menubar (File / Edit / View) on the WAI-ARIA menubar pattern where every menu renders into one shared floating panel, so once a menu is open hovering another title or pressing Left/Right switches instantly while the panel glides and resizes to fit, with Kbd shortcuts, checkbox and radio rows, separators, disabled items, hover-intent submenus, typeahead and a spring-gliding active row.

Preview

Menubar preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/menubar
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

Menubar

value?
string | null

Controlled open menu (`MenubarMenu` value), or null when closed.

—
defaultValue?
string | null
null
onValueChange?
((value: string | null) => void)
—
sideOffset?
number

Gap between the bar and the panel, in px. Default 6.

6
aria-label?
string
—
className?
string
—
panelClassName?
string

Extra classes for the shared floating panel.

—

MenubarMenu

value
string

Identifies the menu for `value`/`onValueChange`.

—

MenubarTrigger

disabled?
boolean
false
className?
string
—

MenubarContent

ariaLabel?
string

Accessible name; defaults to the trigger's text via aria-labelledby.

—
className?
string
—

MenubarItem

icon?
ReactNode

Leading icon (sized to 16px).

—
shortcut?
MenubarShortcut

Trailing shortcut hint: key tokens for `KbdCombo` or any node. Decorative.

—
variant?
"default" | "destructive"
—
disabled?
boolean
—
inset?
boolean

Indent to line up with checkbox/radio rows.

—
textValue?
string

Text used by typeahead when children aren't plain text.

—
onSelect?
((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void)

Call `event.preventDefault()` to keep the menu open.

—
closeOnSelect?
boolean

Default true.

true
className?
string
—

MenubarCheckboxItem

checked?
boolean
—
defaultChecked?
boolean
false
onCheckedChange?
((checked: boolean) => void)
—
disabled?
boolean
—
className?
string
—
variant?
"default" | "destructive"
—
closeOnSelect?
boolean

Default true.

false
textValue?
string

Text used by typeahead when children aren't plain text.

—
shortcut?
MenubarShortcut

Trailing shortcut hint: key tokens for `KbdCombo` or any node. Decorative.

—

MenubarRadioGroup

value?
string
—
defaultValue?
string
—
onValueChange?
((value: string) => void)
—
ariaLabel?
string

Accessible name for the group.

—
className?
string
—

MenubarRadioItem

value
string
—
disabled?
boolean
—
className?
string
—
variant?
"default" | "destructive"
—
closeOnSelect?
boolean

Default true.

false
textValue?
string

Text used by typeahead when children aren't plain text.

—
shortcut?
MenubarShortcut

Trailing shortcut hint: key tokens for `KbdCombo` or any node. Decorative.

—

MenubarLabel

inset?
boolean
false
className?
string
—

MenubarSeparator

className?
string
—

MenubarSubTrigger

icon?
ReactNode
—
disabled?
boolean
—
inset?
boolean
—
textValue?
string
—
className?
string
—

MenubarSubContent

ariaLabel?
string
—
className?
string
—

Updated