Dropdown menu

Compound action menu with keyboard navigation and polymorphic items.

Add it to your project

Eject the complete dropdown-menu group, then import from its generated local barrel. The copied source and CSS belong to your application.

bash
pnpm exec toucan eject dropdown-menu
app.tsx
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/toucan/dropdown-menu';

Use when

A compact trigger reveals a list of actions or navigation choices.

Avoid when

Users are selecting a form value; use Select.

Example

API reference

Generated from packages/react/src/components. Only Toucan-specific props are listed; forwarded native props remain available as noted for each export.

DropdownMenuDropdownMenuContentDropdownMenuItemDropdownMenuLabelDropdownMenuSeparatorDropdownMenuTrigger

DropdownMenu

Props type: DropdownMenuProps

NameTypeDefaultRequiredDescription
anchor"left" | "right" | "top" | "bottom" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "left-top" | "left-center" | "left-bottom" | "right-top" | "right-center" | "right-bottom"'bottom'NoThe edge or alignment used to position the floating content.
defaultOpenbooleanfalseNoInitial open state when the component is uncontrolled.
onOpenChange(open: boolean) => voidundefinedNoCalled when the open state changes.
openbooleanundefinedNoControlled open state.

Also accepts the native div attributes that are not replaced by a Toucan prop.

DropdownMenuContent

Props type: DropdownMenuContentProps

No Toucan-specific props.

Also accepts the native div attributes that are not replaced by a Toucan prop.

DropdownMenuItem

Props type: DropdownMenuItemProps

NameTypeDefaultRequiredDescription
asChildbooleanfalseNoMerge behavior and accessibility props onto the single child element.
disabledbooleanfalseNoPrevents interaction when true.
onSelect() => voidundefinedNoCalled when the item is selected.

Also accepts the native div attributes that are not replaced by a Toucan prop.

DropdownMenuLabel

Props type: DropdownMenuLabelProps

No Toucan-specific props.

Also accepts the native div attributes that are not replaced by a Toucan prop.

DropdownMenuSeparator

Props type: DropdownMenuSeparatorProps

No Toucan-specific props.

Also accepts the native div attributes that are not replaced by a Toucan prop.

DropdownMenuTrigger

Props type: DropdownMenuTriggerProps

NameTypeDefaultRequiredDescription
asChildbooleanfalseNoMerge behavior and accessibility props onto the single child element.

Also accepts the native button attributes that are not replaced by a Toucan prop.

Type exports

DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuSeparatorProps, DropdownMenuTriggerProps

Accessibility

  • Implements menu, menuitem, trigger, arrow-key, Home/End, Escape, and focus-return behavior.

Token families

dropdownfocus

Related components