Skip to main content

Overview

Profile
Settings ⌘S
Log out
Dropdown Menu is a floating panel triggered by a click — used for contextual actions, user account menus, and option lists. It supports icons, keyboard shortcuts, checkboxes, radio items, sub-menus, and separators.

Installation


Usage


Variants

Basic with Icons and Shortcuts

My account
Log out ⇧⌘Q

With Checkbox Items

Appearance

With Sub-menu

Edit
Duplicate
Share

API Reference

boolean
Controlled open state.
(open: boolean) => void
Callback fired when open state changes.
boolean
default:"false"
Uncontrolled default open state.
string
default:"start"
Horizontal alignment relative to the trigger. Values: start · center · end
string
default:"bottom"
Which side to render on. Values: top · right · bottom · left
number
default:"4"
Distance in px between the trigger and the menu.
string
Additional class names for the menu panel.
string
default:"default"
Visual style. "destructive" renders item in red.
boolean
default:"false"
Disables the item — it becomes non-interactive and grayed out.
() => void
Callback fired when the item is selected. Menu closes automatically.
boolean
Controlled checked state.
(checked: boolean) => void
Callback fired when checked state changes.

Accessibility

  • Dropdown menu uses role="menu" with aria-orientation="vertical"
  • Each item has role="menuitem" (or "menuitemcheckbox" / "menuitemradio")
  • Trigger has aria-haspopup="menu" and aria-expanded
  • Keyboard: Arrow keys navigate items, Enter/Space selects, Escape closes, Tab closes and moves focus
  • Sub-menus open on ArrowRight and close on ArrowLeft or Escape

Do’s & Don’ts

Do

  • Group related actions with DropdownMenuSeparator
  • Use DropdownMenuLabel to label groups of items
  • Add keyboard shortcuts via DropdownMenuShortcut for power users
  • Mark destructive items with variant="destructive" for visual clarity

Don't

  • Don’t use Dropdown Menu for navigation — use a Navbar or Sidebar
  • Don’t put more than 10–12 items without grouping or sub-menus
  • Don’t use it for single-action triggers — use a Button
  • Don’t nest sub-menus more than 2 levels deep