Menubar overview
Menubar composes top-level command items and owned menus with keyboard-first navigation, focus transfer, and submenu support.
Imports
Use primitives for full markup ownership, or wrappers for faster composition.
Primitive imports
ts
import {
TngMenubar,
TngMenubarItem,
TngMenu,
TngMenuItem,
} from '@tailng-ui/primitives';Wrapper imports
ts
import { TngMenubarComponent, TngMenuComponent } from '@tailng-ui/components';
import { TngMenubarItem, TngMenuItem } from '@tailng-ui/primitives';Usage patterns
Primitive usage
html
<div tngMenubar aria-label="Workspace commands">
<div tngMenu #fileMenu="tngMenu">
<button type="button" tngMenuItem tngMenuItemValue="New file">New</button>
</div>
<button type="button" tngMenubarItem [tngMenubarMenu]="fileMenu">File</button>
</div>Wrapper usage
html
<tng-menubar ariaLabel="Workspace commands">
<tng-menu #fileMenu="tngMenu" ariaLabel="File menu">
<button type="button" tngMenuItem tngMenuItemValue="New file">New</button>
</tng-menu>
<button type="button" tngMenubarItem [tngMenubarMenu]="fileMenu">File</button>
</tng-menubar>Style variants
Same menubar behavior rendered through plain CSS wrappers and Tailwind utility shells.
Wrapper menubar (plain CSS)
File
last command: No command yet
Wrapper menubar (tailwind)
last command: No command yet
Keyboard baseline
ArrowLeft/ArrowRightmove focus across top-level items.ArrowDownopens owned menus and enters menu item traversal.Escapecloses menus and restores focus to their owning menubar item.