shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Standard
Simple Dropdown with Icons Dropdown Menu for React
A short menu behind a dots button with an icon before Profile, Settings, Help and a destructive Log out.
Plain text rows make people read every word; an icon lets them spot the row. This dropdown menu opens from a dots button and puts an icon before Profile, Settings, Help and Log out, the last one in the destructive color. It's the smallest useful menu, for navbars, cards and toolbars.
Preview
Installation
FAQ
What is in this menu?
Four DropdownMenuItems, Profile, Settings, Help and Log out, each with an aria-hidden icon before the label. There are no groups or separators.
How is Log out marked?
variant="destructive" on its item colors it. It doesn't confirm anything; do that in its handler if you need to.
What does the trigger look like?
An outline Button with size="icon-md", a dots icon and aria-label set to More options, since it has no text.
How do I give the menu a fixed width?
Set a width class on the content part. The demo uses w-40; without one the menu sizes to its rows.
Related
- Dropdown with Groups and Labels Dropdown MenuA menu split into labeled My Account and
- Dropdown with Shortcuts Dropdown MenuA file and clipboard menu behind a menu
- Profile Dropdown with Avatar Dropdown MenuA profile menu opened from a round avatar
- Context Menu with Icons and ShortcutsA context menu whose items each have an
- Standard DialogA share dialog with a read-only link, a
- Dropdown with Checkboxes Dropdown MenuA View menu of checkbox rows that show or