Skip to content

Profile menu

Avatar-triggered account menu that moves identity, settings, and sign-out actions out of crowded application headers.

Preview

Account actions Icons are consumer-supplied React nodes, so apps can use their existing Lucide set.

Marco Beyermarco@example.com
<div class="nx-profilemenu"><button class="nx-profilemenu__trigger" type="button" aria-haspopup="menu" aria-expanded="true"><span class="nx-profilemenu__avatar"><span class="nx-avatar">MB</span></span><span class="nx-profilemenu__trigger-name">Marco Beyer</span></button><div class="nx-profilemenu__panel"><div class="nx-profilemenu__identity"><strong>Marco Beyer</strong><span>marco@example.com</span></div><div class="nx-menu" role="menu"><button class="nx-menu__item" role="menuitem">Profile</button><button class="nx-menu__item nx-menu__item--danger" role="menuitem">Sign out</button></div></div></div>

API

React props (NxKit)

React (NxKit) props
PropTypeDefaultRequiredDescription
nameReactNodeRequiredVisible identity and trigger label.
emailReactNodeundefinedSecondary identity line inside the panel.
initialsReactNodeRequiredFallback avatar content.
avatarReactNodeundefinedOptional profile image/node replacing the initials avatar.
chevronReactNode"⌄"Optional consumer icon, e.g. Lucide ChevronDown.
triggerLabelstringRequiredAccessible trigger name.
itemsNxMenuItem[]RequiredProfile/settings/sign-out actions, including consumer-provided icons.

Classes

Framework-agnostic classes
ClassDescription
.nx-profilemenuRelative trigger/panel root
.nx-profilemenu__triggerAvatar-first 44px account trigger
.nx-profilemenu__panelRight-aligned overlay panel
.nx-profilemenu__identityName/email context above NxMenu

States

compact

Accessibility

  • The trigger exposes aria-haspopup, aria-expanded, and aria-controls; the open menu receives focus and supports the NxMenu keyboard contract.
  • Escape and item activation close the panel and restore focus to the trigger; outside click closes without stealing focus.

Do / Don’t

  • Do: Nest profile, account settings, and sign out here with clear icons and a danger treatment for sign out.Don’t: Don't scatter identity and sign-out controls across the top bar — keep the header focused on global context and navigation.

View in spec →