---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Account menu

The signed-in person's menu: who is signed in, the light and dark choice, and signing out, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `AccountMenu`.

## When to use

- The signed-in person's menu: who is signed in, the light and dark choice, and signing out.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Account menu on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yes
```

```text
Add the Goop Account menu to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { AccountMenu, AccountMenuTrigger, AccountMenuContent, AccountMenuHeader, AccountMenuColorMode, AccountMenuSignOut } from '@/components/ui/goop/account-menu';
import { Sidebar, SidebarContent } from '@/components/ui/goop/sidebar';
import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';

function AppSidebar({ onSignOut }: { onSignOut: () => void }) {
  return (
    <Sidebar aria-label="Main">
      <SidebarContent>{/* your SidebarGroups */}</SidebarContent>
      <div className="px-3 pb-3">
        <AccountMenu>
          <AccountMenuTrigger name="Teodora Valk" email="teodora@fieldwork.test" hue="blue" />
          <AccountMenuContent>
            <AccountMenuHeader />
            <DropdownMenuItem icon="user">Profile</DropdownMenuItem>
            <DropdownMenuItem icon="settings">Settings</DropdownMenuItem>
            <DropdownMenuItem icon="credit-card">Billing</DropdownMenuItem>
            <AccountMenuColorMode />
            <AccountMenuSignOut onSelect={onSignOut} />
          </AccountMenuContent>
        </AccountMenu>
      </div>
    </Sidebar>
  );
}
```

- Fits: account (its recipe); frame: sidebar-foot.
- Also known as: UserMenu, ProfileMenu, AvatarMenu, NavUser, AccountDropdown.
- Put one AccountMenu in an app: at the sidebar's foot with a `row` trigger (after SidebarContent, in a holder 12 px in) or at the top bar's end with an `avatar` one. Inside: AccountMenuHeader, a few DropdownMenuItems (Profile, Settings, Billing), AccountMenuColorMode, AccountMenuSignOut last. Never a hand-made light/dark switch beside it.
- height, width, padding, gap, corner, border, background, text: add no class for these.

## API reference

### Options

- `open?: boolean` — The menu open, held by the caller (with `onOpenChange`).
- `defaultOpen?: boolean` — Open when it first draws.
- `onOpenChange?: (open: boolean) => void` — Called as the menu opens and closes.
- `modal?: boolean` — Whether the rest of the page is shut off while the menu is open (`true` by default).
- `children?: ComponentProps<typeof DropdownMenu>['children']` — An `AccountMenuTrigger`, then an `AccountMenuContent`.

- State: open (open / defaultOpen / onOpenChange); drawn by data-state=open
- Types: ColorModeWords = { light?: string; dark?: string; system?: string }

### Parts

- `AccountMenuTrigger` — The button that opens the account menu; its props: account-menu--trigger.md
- `AccountMenuContent` — The menu the trigger opens (`role="menu"`, named "Account"), the theme's menu panel; also takes container?: HTMLElement | null
- `AccountMenuHeader` — Who is signed in, the menu's first block and no row (the keys and the pointer pass it by)
- `AccountMenuColorMode` — The light/dark choice in the menu; aria-label?: string — The group's name: "Appearance" when left out; words?: ColorModeWords — The rows' words, each replaceable; value?: ColorModeChoice — The choice, held by the caller (with `onValueChange`); left out, the page's own; onValueChange?: (value: ColorModeChoice) => void — Called with the row picked
- `AccountMenuSignOut` — The menu's last row, under a line of its own; icon?: IconName = 'logout' — The pack icon before the words: the pack's `logout` when left out; also takes onSelect?: (event: Event) => void; disabled?: boolean; asChild?: boolean; variant?: 'default' | 'destructive' = 'default'

### AccountMenuTrigger

The button that opens the account menu.

```tsx
import { AccountMenuTrigger } from '@/components/ui/goop/account-menu';
```

### Options

- name: string — Their name: the row's first line, the header's, and the avatar trigger's name.
- email?: string — Their email, under the name in the row trigger and the header.
- initials?: string — One or two letters in the avatar; left out, the name's first letters ("Teodora Valk" → "TV").
- image?: string — The address of their picture, drawn over the initials once it has loaded.
- hue?: AvatarHue — One of the theme's six hues for the avatar (or `neutral`); left out, a hue from the name.
- fill?: string — The avatar's own colour, any CSS colour, instead of a `hue`; its initials stay white.
- variant?: 'row' | 'avatar' = 'row' — `row`: a full-width 44 px row for the sidebar's foot.
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean
- Types: AvatarHue = Exclude<Hue, 'primary'>

## Keyboard

- Enter / Space: open the menu on its first row; on a row, pick it
- ArrowDown: open the menu on its first row; move to the next row, looping
- ArrowUp: open the menu on its last row; move to the row before, looping
- Home / End: the first or the last row
- Escape: close the menu, the focus back on the trigger

## Accessibility

- The part itself answers the keys above.
- expanded: the attribute data-state=open
- open: the attribute data-state=open
- disabled: the prop disabled

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

Shortened to fit: the data-slot values.

## Related

- [Sidebar](/themes/trail/components/sidebar): The app's main navigation down one side of the window.
- [Dropdown menu](/themes/trail/components/dropdown-menu): A menu of actions.
- [Workspace switcher](/themes/trail/components/workspace-switcher): The sidebar's menu that shows the current workspace and switches to another or creates one.
- [Notification center](/themes/trail/components/notification-center): The bell at the end of the top bar, and its panel of notifications.
