Preview

L

Installation

<> import.ts
import { DropdownMenu } from "@/components/ui/dropdown-menu"

Code

<> component.tsx
import { DropdownMenu } from "@/components/ui/dropdown-menu"

<DropdownMenu />

API Reference

DropdownMenu

Headless dropdown menu with custom trigger, alignment, and items.

<> import.ts
import { DropdownMenu, DropdownIcons } from "@/components/ui/dropdown-menu"

Props

PropTypeDefaultDescription
trigger
React.ReactNodeElement that toggles the menu
options
Array<{ label: string; value: string; icon?: React.ReactNode; onClick?: () => void; disabled?: boolean; divider?: boolean }>Menu items
align
"left" | "right" | "center""right"Menu alignment
className
string""Additional CSS classes
onOpenChange
(open: boolean) => voidOpen state callback