Getting Started
Foundations
Integrations
Components
#Installation
npx @dinachi/cli@latest add menu#Usage
tsx
import {
Menu,
MenuTrigger,
MenuPortal,
MenuPositioner,
MenuContent,
MenuItem,
MenuCheckboxItem,
MenuRadioGroup,
MenuRadioItem,
MenuLabel,
MenuSeparator,
MenuShortcut,
MenuSub,
MenuSubTrigger,
MenuSubContent,
} from "@/components/ui/menu"#Examples
#API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | The controlled open state of the menu. |
| defaultOpen | boolean | false | The initial open state for uncontrolled usage. |
| onOpenChange | (open: boolean) => void | — | Callback fired when the menu open state changes. |
| modal | boolean | true | Whether the menu enters a modal state when open. |
| loopFocus | boolean | true | Whether to loop keyboard focus back to the first item when the end is reached. |
| disabled | boolean | false | Whether the menu should ignore user interaction. |
| MenuItem.inset | boolean | false | Adds indentation for nested command-style layouts. |
| MenuCheckboxItem.checked | boolean | — | The controlled checked state of the checkbox item. |
| MenuCheckboxItem.onCheckedChange | (checked: boolean) => void | — | Callback fired when the checkbox item is ticked or unticked. |
| MenuRadioGroup.value | any | — | The controlled value of the selected radio item. |
| MenuRadioGroup.onValueChange | (value: any) => void | — | Callback fired when the selected radio value changes. |
| MenuRadioItem.value | any | — | Value of the radio item. |
| MenuLabel.inset | boolean | false | Adds indentation to section labels. |
| MenuSubTrigger.inset | boolean | false | Adds indentation to submenu triggers. |