Skip to content

User Account Menu

Bootstrap 6 avatar Menu with a profile header, presence status submenu, account links, a dark mode switch and sign out.

Also known as: user account dropdown, avatar dropdown menu, profile dropdown, account menu with status, user menu sign out

User Account Menu live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A Bootstrap 6 user account menu that opens from an avatar button in an app header. The menu has a profile card with name, email and plan badge, a "Set status" submenu, account links, a dark mode switch and a sign-out item. It fits SaaS dashboards, note apps and any product with signed-in users.

How it works

The avatar .uam-trigger is a button with data-bs-toggle="menu", data-bs-placement="bottom-end" and data-bs-auto-close="outside". The last setting keeps the menu open while you change your status or the theme. Both avatars use the Bootstrap 6 .avatar component with an .avatar-status dot.

The status picker uses the new .submenu wrapper: a .menu-item trigger followed by a nested .uam-status-menu. On desktop the plugin opens it on hover, click or the Right arrow key, and flips it to the left when there is no room on the right. Below 576 px, style.css makes the submenu expand inline inside the main menu, because alpha.1 would place it off-screen. Each option shows .menu-item-check only while it has .selected.

script.js handles the rest. Choosing a status swaps the status-online, status-away or status-busy class on every .uam-status-dot, updates .uam-status-label and the trigger's aria-label, and announces the change in .uam-live. The .uam-theme item is a role="switch" button. It flips aria-checked and sets data-bs-theme on .uam-root, so Bootstrap tokens and the component's own variables switch to dark. Link items close the menu with Menu.getOrCreateInstance(trigger).hide(). For the preview, the menu opens on load and .uam-instant skips its fade-in.

Customization

  • Remove data-uam-open-on-load from .uam-root so the menu starts closed.
  • --uam-brand and --uam-brand-soft on .uam-root: change the logo, hover, switch and profile card tint. The dark values sit in .uam-root[data-bs-theme="dark"].
  • --bs-menu-item-padding-y and min-width on .uam-menu: make the menu denser or wider.
  • STATUS_TEXT in script.js: rename the statuses or add one (add a matching .uam-dot--* color).
  • Replace preventDefault() in the .uam-go handler with real navigation, and hook the theme switch to your own saved preference.
  • Change theme-success on .uam-plan to show another plan color.

Use cases

  • App headers: an avatar opens a menu with a profile header and account links
  • Chat and team tools: a presence status submenu lets people set their availability
  • SaaS dashboards: a dark mode switch inside the menu changes the appearance
  • Logged-in websites: a sign-out item ends the session from one place

Accessibility

The trigger's aria-label names the user and current status, and the plugin keeps aria-expanded current on the trigger and the submenu toggle. Arrow keys move through items, Right and Left open and close the submenu, and Escape closes the menu and returns focus to the avatar. The theme item is a switch with aria-checked, and selected statuses carry aria-current. Status changes are announced in a polite live region. Decorative icons and dots are aria-hidden, and transitions stop under prefers-reduced-motion.

Bootstrap 6 notes

Bootstrap 5's .dropdown-menu-end is data-bs-placement="bottom-end", and nested menus are now built in with .submenu. Avatars use the new .avatar and .avatar-status classes, and badges use badge badge-subtle theme-success. Built on Bootstrap 6.0.0-alpha.1, so alpha APIs can still change. Icons come from Bootstrap Icons, and the portrait is from Unsplash; replace it with your users' own photos.

User Account Menu at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Dropdowns
License
Free for personal and commercial use

Questions about this template

Can I use the User Account Menu code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

User Account Menu – free Bootstrap 6 dropdown template
User Account Menu · free Bootstrap 6 dropdown template

More Dropdowns

Hover and Focus Dropdown – free Pure CSS dropdown template

Hover and Focus Dropdown

Dark navbar with pure CSS dropdown menus that open on hover and keyboard focus, plus a small vanilla JS layer for Escape, arrow keys and touch taps.

Notifications Dropdown with User Photos – free Bootstrap 5 dropdown template

Notifications Dropdown with User Photos

Bootstrap 5 navbar bell dropdown listing notifications with user photos, activity icons, times, unread dots and a mark-all-as-read action.

Notifications Dropdown – free Bootstrap 6 dropdown template

Notifications Dropdown

Dark Bootstrap 6 bell Menu with unread count, unread dots, All/Unread filter, relative timestamps and a mark all as read button.

Menu Dropdown Button Variants – free Bootstrap 6 dropdown template

Menu Dropdown Button Variants

Bootstrap 6 Menu dropdowns on buttons: split button with selectable options, drop up, drop end, drop start, headers, icons and dividers.

Nested Multi-Level Dropdown – free Pure CSS dropdown template

Nested Multi-Level Dropdown

Dark navigation bar with a three-level dropdown: flyout submenus on desktop, an inline accordion on mobile, plus hover, click and full keyboard support.

User Account Dropdown – free Bootstrap 5 dropdown template

User Account Dropdown

Bootstrap 5 avatar dropdown with profile header, plan badge, online/away/busy status picker and account menu links for app headers.