Koala logo Design
Esc
No matches for “
↑↓ navigate open Esc close
Components User menu

User menu

Avatar trigger plus dropdown panel. On mobile the panel slides in as a full-screen sheet, on sm+ it's a floating card. Always includes a dark-mode toggle; sign-out is opt-in.

<koala-user-menu>

Canonical

Account

Alex Conveyancer

alex@example.com

Tap the avatar to open the menu. Items + dark-mode toggle render automatically; sign-out is hidden when SignOutAction is null.

Variants

2 variants

Account

Alex Conveyancer

alex@example.com

Standard
IsAdmin = false

Account

Sam Admin

sam@example.com

Admin
Admin + sign-out
IsAdmin = true

Props

1 attribute
Attribute Type Notes
model UserMenuModel Required. Bundles user identity, the admin flag, the menu items, and the sign-out POST URL.

UserMenuModel fields

Field Type Notes
UserIdGuidDrives the avatar URL.
DisplayNamestringShown in the menu header.
Emailstring?Optional second line in the menu header.
FirstName / LastNamestring?Used to compute the initials cache-bust key.
AvatarBlobNamestring?Cache-buster. Falls back to initials-XY when null.
IsAdminboolRenders the crown badge over the avatar + admin row in the panel.
ItemsIReadOnlyList<UserMenuItem>Ordered list of menu rows. Each row is an anchor (Href) or a button (XOnClick).
SignOutActionstring?POST URL for the sign-out form. When null the sign-out row is omitted.

Do & don't

Account

Alex Conveyancer

alex@example.com

Do Drive everything through UserMenuModel. Pass items as a list of UserMenuItem records — one place defines the order.
Don't Don't hand-build the avatar trigger and dropdown panel in markup. The helper bundles the admin crown, mobile sheet transitions, and sign-out form together.