NAVIGATION
UserMenu
Avatar trigger plus a Menu, with the signed-in identity repeated in the panel header. Children are plain MenuItems.
PREVIEW
Last action: nothing yet · initialsOf("Max Gumiero") = MG
SOURCE
import { UserMenu, MenuItem, MenuDivider, MenuLabel } from '@objectifthunes/whiteboard'
<UserMenu name="Max Gumiero" meta="max@example.com">
<MenuLabel>Account</MenuLabel>
<MenuItem icon={<User size={13} />} onSelect={goProfile}>Profile</MenuItem>
<MenuItem icon={<CreditCard size={13} />} onSelect={goBilling}>Billing</MenuItem>
<MenuDivider />
<MenuItem tone="danger" onSelect={signOut}>Sign out</MenuItem>
</UserMenu>
{/* avatar only, for a tight navbar */}
<UserMenu name={user.name} meta={user.email} compact>…</UserMenu>NOTES
Children are plain MenuItems, so what goes in the menu stays yours: profile, billing, workspace switching, sign out. The component only owns the trigger and the identity header.
The name and meta are repeated at the top of the panel. On a compact trigger that header is the only place the signed-in account is visible, and it is worth having even when the trigger shows it too — it confirms which account you are about to act as.
Initials are derived with initialsOf, which takes the first letters of the first and last words. Pass avatar to override with an image.