Dropdown Menu

Navigation

Displays a menu to the user — such as a set of actions or functions — triggered by a button.

Import

import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";

Usage

Default

A simple dropdown menu with labels, items, and separators.

API Reference

defaultOpen
boolean

The open state of the dropdown menu when it is initially rendered

open
boolean

The controlled open state of the dropdown menu

onOpenChange
(open: boolean) => void

Event handler called when the open state of the dropdown menu changes

modaltrue
boolean

Whether the dropdown menu should be modal