Dropdown Menu
Menu with icons, shortcuts, checkbox items, labels and destructive actions. Items cascade in and a highlight follows you.
- Category: Navigation
- Licence: Free, MIT
- Built with: React 19, Tailwind CSS 4, Motion
- Dependencies: motion, clsx, tailwind-merge
Examples
Dropdown Menu
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
trigger | ReactElement | — | |
items | MenuEntry[] | — | item | checkbox | separator | label |
align | "start" | "end" | "start" |
About Dropdown Menu
Dropdown Menu has everything a real menu needs: icons, keyboard shortcuts, checkbox items, group labels and destructive actions. Items cascade in and a highlight follows you as you move.
Dropdown Menu is a navigation component for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.
When to use Dropdown Menu
- Account and profile menus.
- Row actions in tables.
- Editor and toolbar overflow menus.
- Sort and view options.
How it works
It follows the menu pattern: arrow keys move, Enter selects, Escape closes and focus returns to the trigger. Typing a letter jumps to the matching item, and the highlight is one element that glides.
Links and buttons keep their roles, arrow keys move where a group is expected, the current item is marked with aria-current, and focus is always visible. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.
Customizing Dropdown Menu
Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.
The Customize panel next to the preview lets you change align, label live, and the Code tab updates to match, so the snippet you copy already carries your values.
- trigger (ReactElement).
- items (MenuEntry[]): item | checkbox | separator | label.
- align ("start" | "end", default "start").
Goes well with Dropdown Menu
These navigation pieces share its tokens and motion language, so they sit together on one page without clashing.
- Tabs: Animated React tabs with a gliding indicator and panels that slide the way you travel
- Breadcrumb: An animated React breadcrumb that folds long trails and unfolds them on click
- Pagination: Animated React pagination with smart gaps and a pill that glides to the current page
- Sidebar: A collapsible React app sidebar with spring width, fading labels and an active marker
- Steps: Animated React steps for multi-step flows: filling connectors and drawn checks
Install Dropdown Menu
npx shadcn@latest add https://charcoalui.com/r/dropdown-menu.jsonDropdown Menu is free and MIT licensed. The command copies dropdown-menu.tsx into components/ui and installs clsx, tailwind-merge; you can also copy the source from the Code tab by hand.
It pairs well with Morph Menu, a Pro piece: A button that stretches into its own menu surface, then shrinks back. Arrow keys and Escape work.
Frequently asked questions
- How do I install Dropdown Menu?
- Run npx shadcn@latest add https://charcoalui.com/r/dropdown-menu.json. The shadcn CLI copies dropdown-menu.tsx into components/ui and installs motion, clsx, tailwind-merge. You can also copy the source from this page by hand.
- Is Dropdown Menu free for commercial use?
- Yes. Dropdown Menu is MIT licensed: use it in any personal or commercial project and change it however you like.
- Does Dropdown Menu work with Next.js?
- Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
- Can an AI coding agent install Dropdown Menu?
- Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Dropdown Menu's props and source and get_install_command returns the exact command.