Dropdown Menu

Actions and options on a floating board: items, labels, separators, shortcuts, checkbox and radio items, and an optional full-text search.

View as Markdown

Installation

npx shadcn@latest add @cozy/dropdown-menu

Usage

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

Examples

Put DropdownMenuSearch first. Every typed word must appear in the item text or its keywords; case and accents are ignored, so “da lat” finds Đà Lạt. Arrow Down or Enter goes to the first match.

API

Everything else is passed through to the underlying element or Radix primitive.

PropTypeDefaultDescription
DropdownMenuSearch placeholderstring"Search…"Also used as the input's accessible name.
DropdownMenuSearch emptyTextReactNode"Nothing found"Shown when no item matches.
Item keywordsstring[]–Extra words an item matches, on DropdownMenuItem, CheckboxItem and RadioItem.