Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yes

Account menu

Pro

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.

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yes
PROMPT
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
OptionTypeWhat it does
open?booleanThe menu open, held by the caller (with onOpenChange).
defaultOpen?booleanOpen when it first draws.
onOpenChange?(open: boolean) => voidCalled as the menu opens and closes.
modal?booleanWhether 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
PartWhat it is
AccountMenuTriggerThe button that opens the account menu; its props: account-menu--trigger.md
AccountMenuContentThe menu the trigger opens (role="menu", named "Account"), the theme's menu panel; also takes container?: HTMLElement | null
AccountMenuHeaderWho is signed in, the menu's first block and no row (the keys and the pointer pass it by)
AccountMenuColorModeThe 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
AccountMenuSignOutThe 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

KeyWhat it does
Enter SpaceOpen the menu on its first row; on a row, pick it
ArrowDownOpen the menu on its first row; move to the next row, looping
ArrowUpOpen the menu on its last row; move to the row before, looping
Home EndThe first or the last row
EscapeClose 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:

StateDrawn by
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe 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.

goop.so/themes/trail/components/account-menu.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-account-menu.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.