Search documentation

Search the documentation and open a page.

Displays a menu of actions or options when a trigger is activated.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/dropdown-menu

Composition

DropdownMenu ├── DropdownMenuTrigger └── DropdownMenuContent ├── DropdownMenuLabel (optional) ├── DropdownMenuGroup (optional) │ └── DropdownMenuItem | DropdownMenuCheckboxItem | DropdownMenuRadioItem │ ├── DropdownMenuItemText │ └── DropdownMenuShortcut (optional) ├── DropdownMenuRadioGroup (optional) ├── DropdownMenuSeparator (optional) └── DropdownMenuSub (optional) ├── DropdownMenuSubTrigger └── DropdownMenuSubContent

Examples

Checkboxes

Loading...

Default Example

Loading...

Default

Loading...

Radio

Loading...
Loading...

User Profile

Loading...

With Icons

Loading...

With Shortcuts

Loading...

API Reference

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
defaultHighlightedValuestring | null | undefined—Configures default highlighted value.
highlightedValuestring | null | undefined—Configures highlighted value.
onHighlightChange((details: HighlightChangeDetails) => void) | undefined—Runs when highlight changes.
onSelect((details: SelectionDetails) => void) | undefined—Runs when select changes.
anchorPointPoint | null | undefined—Configures anchor point.
loopFocusboolean | undefined—Configures loop focus.
positioningPositioningOptions | undefined—Configures floating-element placement and collision handling.
closeOnSelectboolean | undefinedtrueConfigures close on select.
openboolean | undefined—Whether the component is open when controlled.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
typeaheadboolean | undefined—Configures typeahead.
compositeboolean | undefined—Configures composite.
navigate((details: NavigateDetails) => void) | null | undefined—Configures navigate.
triggerValuestring | null | undefined—Configures trigger value.
defaultTriggerValuestring | null | undefined—Configures default trigger value.
onTriggerValueChange((details: TriggerValueChangeDetails) => void) | undefined—Runs when trigger value changes.

Context, Hooks, and Types

ExportAPI
DropdownMenuContextRender-prop component that exposes component state and actions.
DropdownMenuRootProviderProvides an externally created API to the component tree.
useDropdownMenuCreates or accesses the component API.
useDropdownMenuContextReturns the nearest component API.