Component
Dropdown Menu
Place secondary actions in a compact menu with roving focus, typeahead, disabled states, and escape handling.
Interactive preview
Usage
Import the component entry and start with its smallest complete example.
Import
import { DropdownMenu } from "@chitrank2050/monoline-ui/dropdown-menu"Basic usage
<DropdownMenu>
<DropdownMenu.Trigger asChild><Button variant="secondary">Actions</Button></DropdownMenu.Trigger>
<DropdownMenu.Content side="bottom" align="end">
<DropdownMenu.Label>Project</DropdownMenu.Label>
<DropdownMenu.Item>Duplicate <DropdownMenu.Shortcut>⌘D</DropdownMenu.Shortcut></DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item destructive>Delete</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu>Usage guidance
Choose the component for its interaction model and semantics before customizing its appearance.
DropdownMenu groups secondary actions that belong to one trigger and benefit from compact keyboard navigation.
The choices are form values, primary navigation, or important enough to remain visible without opening a menu.
DropdownMenu supplies menu roles, roving focus, typeahead, Escape handling, and focus restoration. Item labels must describe actions rather than destinations ambiguously.
This component needs browser JavaScript for state or browser APIs.
API reference
Props, slots, and callbacks available on this component.
Design tokens
Theme variables this component reads for color, spacing, and motion.
Implementation
The source used by the example above, including any state it needs.
<DropdownMenu>
<DropdownMenu.Trigger asChild><Button variant="secondary">Actions</Button></DropdownMenu.Trigger>
<DropdownMenu.Content side="bottom" align="end">
<DropdownMenu.Label>Project</DropdownMenu.Label>
<DropdownMenu.Item>Duplicate <DropdownMenu.Shortcut>⌘D</DropdownMenu.Shortcut></DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item destructive>Delete</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu>Related documentation
Compare related components or review the package and theme setup.