Menu
moleculeCompound-component dropdown menu with portal rendering, 8-direction placement with auto-flip, full WAI-ARIA keyboard navigation, and scale + fade animations. Supports selected, danger, disabled items, shortcut hints, and grouped sections.
Basic menu
Simple dropdown with items, separator, and a danger action.
Selected & shortcuts
Items with selected state and keyboard shortcut hints.
Grouped with sizes
MenuGroup sections with labels, shown in small size.
Usage
Installation
API Reference
Menu props — * required
| Prop | Type | Default | Description |
|---|---|---|---|
trigger* | React.ReactNode | — | The element that opens the menu on click. |
size | "sm" | "md" | "lg" | "md" | Size variant — flows through context to all items. Font sizes aligned with Button. |
placement | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "right" | "bottom-start" | Preferred placement of the popover. Automatically flips at viewport edges. |
open | boolean | — | Controlled open state. |
onOpenChange | (open: boolean) => void | — | Callback when open state changes. |
children* | React.ReactNode | — | MenuItem, MenuSeparator, and MenuGroup children. |