Menubar
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { Menubar } from "@corew500/ui/menubar"
<Menubar>Content</Menubar>API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| modal | enum | true | Whether the menubar is modal. |
| disabled | enum | false | Whether the whole menubar is disabled. |
| orientation | enum | 'horizontal' | The orientation of the menubar. |
| loopFocus | enum | true | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| style | enum | — | Style applied to the element, or a function that returns a style object based on the component’s state. |
| className | enum | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
| render | enum | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
Accessibility
Keyboard Navigation
- Keyboard navigation: Arrow keys between triggers, Enter/Space to open
- Escape closes menu, Tab moves focus out
Screen Readers
- - Uses menubar role with proper ARIA attributes
- Menu items announced with role and state
Localization
Translatable Content
- - Pass translated strings to MenubarTrigger, MenubarItem, MenubarLabel
Additional
- MenubarShortcut should display localized keyboard shortcuts