Skip to content

Profile Menu

<loomi-profile-menu> — a compact profile trigger with avatar, name, description, chevron, and a dropdown menu. It composes <loomi-card>, <loomi-avatar>, and <loomi-dropmenu>, so avatar dots, pulsing dots, verification badges, and menu-item behavior all come from the existing Loomi primitives.

Terminal window
npm install @loomidev/profile-menu lit
import "@loomidev/profile-menu";

Put <loomi-dropmenu-item> elements inside the profile menu. Clicking the card trigger opens the dropdown.

Profile Settings Sign out
<loomi-profile-menu
name="Alice Wonderland"
description="alice@loomiui.com"
avatar="/avatars/female.jpg"
>
<loomi-dropmenu-item icon="user-circle">Profile</loomi-dropmenu-item>
<loomi-dropmenu-item icon="cog-6-tooth">Settings</loomi-dropmenu-item>
<loomi-dropmenu-item divider></loomi-dropmenu-item>
<loomi-dropmenu-item icon="arrow-right-start-on-rectangle" variant="destructive">
Sign out
</loomi-dropmenu-item>
</loomi-profile-menu>

Avatar behavior is passed to the internal <loomi-avatar>.

Account
<loomi-profile-menu
name="Alice Wonderland"
description="alice@loomiui.com"
avatar="/avatars/female.jpg"
dotted
pulse-dot
verified
dot-color="success"
dot-position="top"
>
<loomi-dropmenu-item>Account</loomi-dropmenu-item>
</loomi-profile-menu>

If avatar is blank, initials are derived from name. Set avatar-label to control the fallback text yourself.

By default the avatar leads the trigger. Set avatar-position="right" to flip it: the name and description lead, the avatar follows, and the chevron stays at the trailing edge — so the menu still opens aligned under the chevron.

Profile Settings
<loomi-profile-menu
avatar-position="right"
name="Alice Wonderland"
description="alice@loomiui.com"
avatar="/avatars/female.jpg"
>
<loomi-dropmenu-item icon="user-circle">Profile</loomi-dropmenu-item>
<loomi-dropmenu-item icon="cog-6-tooth">Settings</loomi-dropmenu-item>
</loomi-profile-menu>

This variant suits right-aligned app headers, where the avatar reads better closest to the edge of the screen. Everything else — avatar dots, verification badge, transparent trigger, and menu behavior — works exactly the same.

Use transparent when the profile menu sits on an existing surface and should not add its own card fill. Add has-hover when you want a very subtle border on hover.

Profile
<loomi-profile-menu
transparent
has-hover
name="Alice Wonderland"
description="alice@loomiui.com"
avatar-label="AW"
>
<loomi-dropmenu-item>Profile</loomi-dropmenu-item>
</loomi-profile-menu>

The menu is powered by <loomi-dropmenu>, so the same placement, divided rows, scrolling, keyboard navigation, and hide-after-click behavior apply.

Profile Settings
<loomi-profile-menu name="Alice Wonderland" placement="right" divided>
<loomi-dropmenu-item icon="user-circle">Profile</loomi-dropmenu-item>
<loomi-dropmenu-item icon="cog-6-tooth">Settings</loomi-dropmenu-item>
</loomi-profile-menu>

loomi-profile-menu uses a real dropmenu trigger button from <loomi-dropmenu>, and menu rows keep the menu roles and keyboard behavior from <loomi-dropmenu-item>.

  • Use a clear name and description; they become the visible trigger text.
  • Use avatar-alt when the avatar image needs a specific accessible description.
  • Keep destructive actions marked with variant="destructive" on the menu item.

For the library-wide baseline, see Foundations — Accessibility.

The trigger is shrink-wrapped by default, with text truncation for long names and descriptions. It works well in headers, sidebars, app shells, and compact account menus.

For the shared container and viewport rules, see Foundations — Responsive behavior.

loomi-profile-menu uses Loomi semantic tokens such as --loomi-surface, --loomi-surface-border, --loomi-text, and --loomi-text-muted, so the trigger and menu inherit your app theme.

For theme activation, token overrides, and contrast guidance, see Foundations — Dark mode.

AttributeDefaultDescription
name(blank)Main identity text. Also used for avatar initials when avatar-label is blank.
description(blank)Secondary text under the name, often an email or role.
avatar(blank)Avatar image URL.
avatar-labelderivedInitials/fallback label for the internal <loomi-avatar>.
avatar-altderivedAccessible alt text for the avatar image.
avatar-sizeregularAvatar size — defers to the internal <loomi-avatar> size.
avatar-bg-colorgrayInitials background color passed to <loomi-avatar>.
avatar-positionleftWhere the avatar sits in the trigger. left | right. With right, the copy leads and the chevron stays trailing.
dottedfalseShow avatar status dot. (boolean)
pulse-dotfalseAnimate the avatar status dot. (boolean)
dot-colorsuccessStatus dot color.
dot-positionbottomtop | bottom.
verifiedfalseShow the avatar verification badge. (boolean)
has-hoverfalseShow a subtle border on trigger hover/focus. (boolean)
transparentfalseRemove the trigger card fill. (boolean)
placementrightDropmenu placement. auto | left | right. Defaults to right so the menu opens right-aligned, under the chevron.
dividedfalseAdd dividers between menu items. (boolean)
scrollablefalseCap menu height and scroll overflow. (boolean)
height200Scrollable menu height in pixels.
hide-after-clicktrueClose the menu after clicking a non-toggle item. (boolean)
SlotDescription
(default)Content placed inside the component.
  • @loomidev/avatar
  • @loomidev/card
  • @loomidev/core
  • @loomidev/dropmenu
  • @loomidev/icons
  • @loomidev/theme