shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Profile
Profile Dropdown with Avatar Dropdown Menu for React
A profile menu opened from a round avatar button, with the user's name and email above Profile, Settings, Help and Log out.
The avatar in the corner of the navbar that opens your account. This dropdown menu opens from a round ghost button holding an Avatar, shows the name and email at the top, then Profile, Settings and Help, and a destructive Log out. It fits any app with signed-in users.
Preview
Installation
FAQ
What is the profile button?
A ghost Button with pill and size="icon-lg" around the avatar, with aria-label set to Open account menu, since the picture alone has no name.
DropdownMenuTrigger renders the button through render, and the avatar goes inside the trigger.
What is at the top of the menu?
A DropdownMenuLabel with font-normal holding the name, shadcn, over m@example.com. It's the label of the first DropdownMenuGroup, so screen readers announce the group by it, and it can't be focused.
Which commands follow the header?
Profile, Settings and Help, each after an aria-hidden icon, then a separator and Log out. The menu is w-56 and lines up with the end of the button.
Does the destructive variant confirm Log out?
No. variant="destructive" only colors the row. Sign out, or open an Alert Dialog first, from its handler.
Related
- Profile Dropdown with Status Dropdown MenuA profile menu whose avatar shows an
- Account Settings Dropdown Dropdown MenuAn account menu opened from the user's
- Profile with Preferences Dropdown MenuA profile menu with Profile and Settings
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an
- Avatar StandardA round avatar with a profile picture and
- Button with Text (Standard)The one filled action