Skip to content

Menubar ​

A visually persistent menu common in desktop applications. While a menu is open, hovering another trigger switches to it and ← / → move between menus. Menus that don't fit collapse into a trailing "More" menu.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Responsive ​

The bar measures its own width. Narrow it and the trailing menus move into "More", listed under their names.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SMenubar ​

shadcn-vue Menubar: a horizontal bar (h-9 rounded-md border p-1 shadow-xs) of menu triggers, each opening an anchored dropdown below it. While one menu is open, hovering (or tapping) another trigger switches to it, and ← / → move between menus.

Responsive: the bar measures itself; menus whose triggers don't fit collapse into a trailing "More" (ellipsis) trigger listing their items under labels. On compact touch screens menus open as bottom sheets.

PropTypeDefaultDescription
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'

Slots: children (trailing closure)

SMenubarMenu ​

One menu of the bar: a trigger plus its content.

Slots: children (trailing closure)

SMenubarTrigger ​

rounded-sm px-2 py-1 text-sm font-medium, accent while its menu is open.

PropTypeDefaultDescription
textResourceStr''

SMenubarContent ​

The menu's dropdown: bg-popover min-w-[12rem] rounded-md border p-1 shadow-md, below its trigger.

PropTypeDefaultDescription
panelWidthnumber192panel width in vp (min-w-[12rem] = 192); rows size against it
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'

Slots: children (trailing closure)

SMenubarItem ​

Action row; closes the menu after activation (unless keepOpen). Tap, click, Space / Enter and screen-reader activation fire onSelect (a .onClick() chained on the item does not fire).

PropTypeDefaultDescription
textResourceStr''
iconstring | undefinedundefined
shortcutstring | undefinedundefined
variantMenuItemVariant
MenuItemVariant = 'default' | 'destructive'
'default'
disabledbooleanfalse
insetbooleanfalse
keepOpenbooleanfalse
EventTypeDefaultDescription
onSelect() => void() => { }

SMenubarCheckboxItem ​

PropTypeDefaultDescription
valuestring''identity for the uncontrolled memory (default: the label)
textResourceStr''
shortcutstring | undefinedundefined
checked!!boolean | undefinedundefined
defaultCheckedbooleanfalse
disabledbooleanfalse
EventTypeDefaultDescription
onCheckedChange(v: boolean) => void() => { }

SMenubarRadioGroup ​

PropTypeDefaultDescription
namestring''identity for the uncontrolled memory (default: the defaultValue)
value!!string | undefinedundefined
defaultValuestring''
EventTypeDefaultDescription
onValueChange(v: string) => void() => { }

Slots: children (trailing closure)

SMenubarRadioItem ​

PropTypeDefaultDescription
valuestring''
textResourceStr''
disabledbooleanfalse

SMenubarLabel ​

PropTypeDefaultDescription
textResourceStr''
insetbooleanfalse

SMenubarSeparator ​

No props.

SMenubarGroup ​

Slots: children (trailing closure)

MIT Licensed