User Menu
The account menu. The trigger is an Avatar alone by default, or just the signed-in name when showName is set — the email moves into the panel instead, since the trigger no longer carries it. fullWidth additionally stretches that trigger to fill its container — the shape a drawer/footer row needs — and is ignored where the trigger sits inline among other controls (e.g. a header). The trigger (and the Avatar inside it, avatar-only) always carries Sidebar's current-page tint (bg-selected text-selected-foreground), not just on hover — it reads as a standing part of navigation rather than a generic hoverable row. With showName, the panel opens flush against the trigger and matched to its width, select-style, rather than floating free. Opening it reveals the email and a logout action — viewing preferences live in DisplayControls beside the trigger, not in here, since they are switches rather than account actions.
Avatar and named triggers
Avatar-only for a header where space is tight; showName puts the name in the trigger and folds the email into the panel instead. Either way the trigger carries Sidebar's current-page tint even at rest — the one deliberate exception to that treatment, so the account control reads as a standing part of navigation rather than a generic hoverable row.
<UserMenu {user} />
<UserMenu {user} showName />Filling a row
fullWidth stretches the trigger to fill its container — the shape a drawer or sidebar footer row needs. It only means anything alongside showName, and is ignored where the trigger sits inline among other controls.
<div class="w-64">
<UserMenu {user} showName fullWidth />
</div>API
| Prop | Type | Default | Description |
|---|---|---|---|
user | {email: string, name?: string} | Signed-in user. Menu renders nothing when omitted or without an | |
onLogout | () => void | Called when the logout action is clicked. | |
showName | boolean | false | Renders just the name as the trigger, with the email folded into the panel. Avatar-only otherwise. |
fullWidth | boolean | false | Stretches the trigger to fill its container, e.g. a drawer footer row. Only meaningful with |