npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-account-menu.json --yesAccount menu
ProThe signed-in person's menu, for React and Tailwind CSS. Part of Goop Pro.
import {
AccountMenu,
AccountMenuColorMode,
AccountMenuContent,
AccountMenuHeader,
AccountMenuShortcut,
AccountMenuSignOut,
AccountMenuTrigger,
} from '@/components/ui/goop/account-menu';
import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';
function RailAccount({ onSignOut }: { onSignOut: () => void }) {
return (
<AccountMenu>
<AccountMenuTrigger variant="avatar" name="Anh Trinh" email="anh@fieldwork.test" hue="green" />
<AccountMenuContent>
<AccountMenuHeader />
<DropdownMenuItem icon="tabler-outline:user">Profile</DropdownMenuItem>
<DropdownMenuItem icon="tabler-outline:settings">
Settings
<AccountMenuShortcut>⌘,</AccountMenuShortcut>
</DropdownMenuItem>
<AccountMenuColorMode />
<AccountMenuSignOut onSelect={onSignOut} />
</AccountMenuContent>
</AccountMenu>
);
}When to use
- The signed-in person's menu.
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>/meadow-account-menu.json --yesAdd the Goop Account menu to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
AccountMenu,
AccountMenuColorMode,
AccountMenuContent,
AccountMenuHeader,
AccountMenuShortcut,
AccountMenuSignOut,
AccountMenuTrigger,
} from '@/components/ui/goop/account-menu';
import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';
function RailAccount({ onSignOut }: { onSignOut: () => void }) {
return (
<AccountMenu>
<AccountMenuTrigger variant="avatar" name="Anh Trinh" email="anh@fieldwork.test" hue="green" />
<AccountMenuContent>
<AccountMenuHeader />
<DropdownMenuItem icon="tabler-outline:user">Profile</DropdownMenuItem>
<DropdownMenuItem icon="tabler-outline:settings">
Settings
<AccountMenuShortcut>⌘,</AccountMenuShortcut>
</DropdownMenuItem>
<AccountMenuColorMode />
<AccountMenuSignOut onSelect={onSignOut} />
</AccountMenuContent>
</AccountMenu>
);
}- Fits: account (its recipe); frame: sidebar-foot.
- Also known as: UserMenu, ProfileMenu, AvatarMenu, NavUser, AccountDropdown.
- Inside: AccountMenuHeader, a few DropdownMenuItems (Profile, Settings with an AccountMenuShortcut), AccountMenuColorMode, AccountMenuSignOut last. Never a hand-made light/dark switch beside it.
- height, width, padding, gap, corner, background, text, motion: 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 (the menu's own default, true). |
| children? | ComponentProps<typeof DropdownMenu>['children'] | An AccountMenuTrigger, then an AccountMenuContent. |
- State: open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-highlighted, data-disabled
| 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, 220 px wide; 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; its props: account-menu--color-mode.md |
| AccountMenuSignOut | The menu's last row, under a line of its own; its props: account-menu--sign-out.md |
| AccountMenuShortcut | A row's key hint |
AccountMenuColorMode
The light/dark choice in the menu.
import { AccountMenuColorMode } from '@/components/ui/goop/account-menu';Options
- 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; the page's mode changes only when the rows are left to the page.
- Types: ColorModeWords = { system?: string; light?: string; dark?: string }
AccountMenuSignOut
The menu's last row, under a line of its own.
import { AccountMenuSignOut } from '@/components/ui/goop/account-menu';Options
- icon?: IconName — The pack icon before the words: the second pack's
tabler-outline:logoutwhen left out. - variant?: 'default' | 'destructive' = 'default' —
destructive: the row in the theme's red, as a red menu row is drawn (for a sign-out that also ends every other session);default(left out) the plain row. - Also takes: onSelect?: (event: Event) => void; disabled?: boolean; asChild?: boolean
AccountMenuTrigger
The button that opens the account menu.
import { AccountMenuTrigger } from '@/components/ui/goop/account-menu';Options
- name: string — Their name: the row trigger's first line, the header's, and the avatar trigger's name ("Account: <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?: 'blue' | 'green' | 'orange' | 'pink' | 'red' | 'yellow' | 'neutral' — One of the six hue words for the avatar (or
neutral, the grey), readable in light and dark; left out, the colour taken from the name, the same as any avatar given that name. - fill?: string — The avatar's own colour, any CSS colour, instead of a
hue; its initials stay light. - variant?: 'row' | 'avatar' = 'row' —
row(the default): a full-width 44 px row for a sidebar panel's foot — the avatar, the name over the email, a chevron. - Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean
Keyboard
| Key | What it does |
|---|---|
| Enter | On the trigger: open, the first row active |
| Space | On the trigger: open, the first row active |
| ArrowDown | On the trigger: open, the first row active |
| ArrowUp | On the trigger: open, the last row active |
| ArrowDown ArrowUp | Move the active row, looping past either end |
| Home End | First or last row |
| Enter | Pick the active row and close (a colour row keeps the menu open) |
| Escape | Close, the focus back on the trigger |
| Tab | Close |
Accessibility
- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| expanded | the attribute data-state=open |
| open | the attribute data-state=open |
| highlighted | the attribute data-highlighted |
| disabled | the attribute data-disabled |
Motion
- The part sets its own motion: add no transition or animation of your own.
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.