affectUI › Components › Navigation

Profile Menu

Account card with the signed-in user, menu actions and profile setup progress.

Free and open source (MIT). Install: npx shadcn@latest add https://www.affectui.com/r/profile-menu.json · Import from @/components/ui/profile-menu

When to use

  • The dropdown behind the avatar in an app header
  • Nudging people to finish their profile, right next to the account actions

When not to use

  • Long menus with nested levels – use a full dropdown menu with submenus
  • Long onboarding flows with many steps – use a checklist like the Setup Guide instead

Usage

import { ProfileMenu, SettingsIcon, LogoutIcon } from "@/components/ui/profile-menu";

export function Account() {
  return (
    <ProfileMenu
      name="Lena Hartmann"
      email="lena.hartmann@fastmail.com"
      items={[
        { id: "settings", label: "Settings", icon: <SettingsIcon />, onSelect: openSettings },
        { id: "logout", label: "Logout", icon: <LogoutIcon />, onSelect: signOut },
      ]}
      setup={{ done: 3, total: 5, next: "Add a profile photo", onContinue: openProfile }}
    />
  );
}

Props

NameTypeDefaultDescription
namestringName of the signed-in user
emailstringEmail under the name, cut off with an ellipsis when long
avatarReactNodeReplaces the default avatar, e.g. an <img>
itemsProfileMenuItem[]Actions with label, icon, optional badge and onSelect
setupProfileSetupProfile setup progress: done, total, the next step and onContinue – leave empty to hide
classNamestringExtra class on the card

Keyboard

  • Tab: Move into the menu
  • ↑ / ↓: Move between the actions
  • Home / End: Jump to the first or last action
  • Enter / Space: Run the focused action

Accessibility

  • Actions are buttons in a menu role, so screen readers announce them as menu items
  • The setup bar is a progressbar with its percentage as value

Responsive

  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19

Related

  • Progress Tracker – Onboarding checklist with an animated progress bar, ticks that draw themselves and auto play