A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands.
Philosophy
Menubars bring desktop-application navigation patterns to the web. The keyboard model (arrow keys between menus, type-ahead navigation, submenu traversal) follows established platform conventions and is powered by @gentleduck/primitives/menubar.
Set the direction once with DirectionProvider (or <html dir="rtl">) and the menubar follows. Menus align to the right edge of their triggers, sub-menus open to the left, and ArrowLeft/ArrowRight move between menus in visual order.
Motion
Alpha: Motion Compositions
Motion components work standalone, but some compositions may behave unexpectedly: this is still under active development. If you find a broken composition, please file an issue.
Use MotionMenubarContent for a scaleIn enter animation (fade, scale, and blur) with a bouncy spring transition, powered by motion. Exit uses the primitive's built-in CSS animation.
Requires the motion package. Use MotionMenubarContent instead of MenubarContent. All other sub-components stay the same.
API Reference
Components in this file wrap @gentleduck/primitives/menubar.
Menubar
Prop
Type
Default
Description
value
string
''
Controlled currently-open menu value
defaultValue
string
''
Initial open menu value for uncontrolled usage
onValueChange
(value: string) => void
-
Callback when open menu value changes
loop
boolean
true
Loops roving focus across triggers
dir
'ltr' | 'rtl'
-
Text direction. Resolved by primitives useDirection (dir prop -> DirectionProvider -> <html dir>).
Additional props inherited from MenubarPrimitive.SubContent
MotionMenubarContent
Same props as MenubarContent. Adds a scaleIn enter animation (fade, scale, and blur) with a bouncy spring transition via motion. Exit uses the primitive's CSS animation. Requires the motion package.