npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yesAccount menu
ProThe 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.
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>
);
}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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yesAdd the Goop Account menu to this project. The install steps are at https://goop.so/docs/install.mdUsage
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
rowtrigger (after SidebarContent, in a holder 12 px in) or at the top bar's end with anavatarone. 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
| Option | Type | What it does |
|---|---|---|
| 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 }
| Part | What it is |
|---|---|
| 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.
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
| Key | What it does |
|---|---|
| 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.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| 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.