User menu

A React component in Beamline's Navigation category, in the free sample.

The account menu behind the avatar: who is signed in, status, theme, account pages and sign out with progress; a bottom sheet on phones.

Use it for

  • The account menu behind the avatar: profile, settings, status, theme, sign out.

Not for

  • Switching workspaces (the sidebar header).

Anatomy

  • trigger (avatar, presence, name)
  • header (avatar, name, email, plan)
  • Status submenu
  • Theme inline (Light · Dark · System, travelling thumb)
  • items with shortcuts
  • Sign out
  • PresenceDot

States

  • closed
  • open
  • signing out
  • phone sheet
  • sign-out failure

Keyboard

  • Same as the dropdown menu
  • shortcuts are shown, the app binds them

Motion

Same surface and rows as the dropdown menu. Theme is inline: three choices on a well whose raised thumb travels to the new choice (useIndicator + contour) while the menu stays open. A sign-out failure grows in above the row. The trigger acknowledges hover and press at once (.ix). The bottom sheet on phones.

Props

PropTypeDefaultDescription
user{ name, email?, avatarSrc?, plan? }—Signed-in account shown in the user menu. Required.
status / defaultStatus / onStatusChange"online" | "away" | "busy" | "offline"—status: Controlled presence status; omit to use defaultStatus. defaultStatus: Initial status when uncontrolled. Defaults to "online". onStatusChange: Reports status after a change; no callback by default.
theme / defaultTheme / onThemeChange"light" | "dark" | "system"—theme: Controlled colour theme; omit to use defaultTheme. defaultTheme: Initial theme when uncontrolled. Defaults to "system". onThemeChange: Reports theme after a change; no callback by default.
items{ label, icon?, keys?, href?, onSelect? }[]—Profile, Billing, Settings…
onSignOut() => void | Promise<unknown>—Signs out; return a promise and the row shows progress until it settles.
showName / showThemeboolean—showName: The name beside the avatar on the trigger. showTheme: Show the theme choice. Default true.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the button or trigger; no ref by default.
classNamesUserMenuClassNames—Classes for the named visual parts; no part overrides by default.
menuClassNames / sheetClassNamesMenuClassNames / BottomSheetProps["classNames"]—menuClassNames: Classes for the menu component's named parts; no overrides by default. sheetClassNames: Classes for the sheet component's named parts; no overrides by default.
menuClassNamesMenuClassNames—Classes for the menu component's named parts; no overrides by default.
sheetClassNamesPartial<Record<"root" | "header" | "title" | "description" | "body" | "backdrop" | "han…—Classes for the sheet component's named parts; no overrides by default.
statusPresenceStatus—Controlled presence status; omit to use defaultStatus.
defaultStatusPresenceStatus—Initial status when uncontrolled. Defaults to "online".
onStatusChange((status: PresenceStatus) => void)—Reports status after a change; no callback by default.
themeThemePreference—Controlled colour theme; omit to use defaultTheme.
defaultThemeThemePreference—Initial theme when uncontrolled. Defaults to "system".
onThemeChange((theme: ThemePreference) => void)—Reports theme after a change; no callback by default.
showThemeboolean—Show the theme choice. Default true.
signOutKeysstring[]—Keycaps displayed beside Sign out; omitted by default and never registers a shortcut.
align"center" | "end" | "start"—Alignment within the available space. Defaults to "end".
showNameboolean—The name beside the avatar on the trigger.
openboolean—Controlled open state; omit to use defaultOpen.
defaultOpenboolean—Initial open state when uncontrolled. Defaults to false.
onOpenChange((open: boolean) => void)—Reports open state after a change; no callback by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLButtonElement>—Receives the button or trigger; no ref by default.
classNamestring—Classes on the documented visual root; no override by default.

Built from

Dependencies

@radix-ui/react-dropdown-menu, lucide-react

Import

import { UserMenu, PresenceDot } from "@beamline/user-menu";

Get it

User menu is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. User menu is included in the free MIT sample. Get Beamline · Connect your agent

More in Navigation

  • Sidebar: The app's main navigation: sections, items with counts and one level of sub-pages, an icon rail with tooltips (⌘B, the trigger or the edge), and a sheet…
  • Tree view: Nested folders and records with the full tree keyboard model (arrows, Home/End, *, type to jump), depth guides, counts and animated opening.
  • Stepper: Where someone is in a multi-step flow: done steps carry a check, the current one a ring, and the line between marks fills as steps complete.
  • Table of contents: The sections of a long page beside it, with the one being read marked as you scroll: the marker travels down the rail between sections, the rail fills…
  • Tabs: Switches between panels of one object; one indicator slides to the active tab, counts sit beside labels, and the tabs a row has no room for fold into More.
  • Navigation menu: A site or docs header whose sections open into one panel that resizes and slides between them; NavigationMenuCard is the standard link row.
  • Menu bar: A desktop-style File / Edit / View bar for editor-like apps; each menu takes the same rows as the dropdown menu, and pointing moves between open menus.
  • Pagination: Moves through pages of a known length: first, last and the current page's neighbours, with an optional “41–60 of 468”. It answers to its own room…
  • Breadcrumb: Where a page sits and the way back up; it shows as many levels as its room holds and folds the ones nearest the top into a menu.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.