DropdownMenuContent
The menu's panel (role="menu").
import { DropdownMenuContent } from '@/components/ui/goop/dropdown-menu';Options
- container?: HTMLElement | null — Where the panel is portalled; the end of
<body>when left out.
npx shadcn@4.23.1 add @goop/meadow-dropdown-menuA menu of actions opened from its button, for React and Tailwind CSS. Free, MIT.
import { DropdownMenuPortal, DropdownMenuGroup, DropdownMenuDescription, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from '@/components/ui/goop/dropdown-menu';
import { useState } from 'react';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuTrigger,
} from '@/components/ui/goop/dropdown-menu';
function NoteMenu({ onDelete }: { onDelete(): void }) {
const [starred, setStarred] = useState(true);
const [group, setGroup] = useState('site');
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton aria-label="Note menu">
<IconButtonIcon icon="chevron-down" />
</IconButton>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuLabel>This note</DropdownMenuLabel>
<DropdownMenuItem icon="copy">
Copy
<DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuCheckboxItem icon="star" checked={starred} onCheckedChange={setStarred}>
Starred
</DropdownMenuCheckboxItem>
<DropdownMenuRadioGroup aria-label="Group by" value={group} onValueChange={setGroup}>
<DropdownMenuRadioItem value="site">By site</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="crew">By crew</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
<DropdownMenuSeparator />
<DropdownMenuItem icon="trash" variant="destructive" onSelect={onDelete}>
Remove
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}Open the Inbox menu with a click or the keyboard: "Mark all as read" clears the count on the button, "Show read notices" hides the read ones, the order rows sort the list, the submenu moves the first notice away, and the red row deletes the read ones. The notices live in the page only.
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 Dropdown menu on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.
npx shadcn@4.23.1 add @goop/meadow-dropdown-menuAdd the Goop Dropdown menu to this project. The install steps are at https://goop.so/docs/install.mdimport { DropdownMenuPortal, DropdownMenuGroup, DropdownMenuDescription, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from '@/components/ui/goop/dropdown-menu';
import { useState } from 'react';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuTrigger,
} from '@/components/ui/goop/dropdown-menu';
function NoteMenu({ onDelete }: { onDelete(): void }) {
const [starred, setStarred] = useState(true);
const [group, setGroup] = useState('site');
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton aria-label="Note menu">
<IconButtonIcon icon="chevron-down" />
</IconButton>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuLabel>This note</DropdownMenuLabel>
<DropdownMenuItem icon="copy">
Copy
<DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuCheckboxItem icon="star" checked={starred} onCheckedChange={setStarred}>
Starred
</DropdownMenuCheckboxItem>
<DropdownMenuRadioGroup aria-label="Group by" value={group} onValueChange={setGroup}>
<DropdownMenuRadioItem value="site">By site</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="crew">By crew</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
<DropdownMenuSeparator />
<DropdownMenuItem icon="trash" variant="destructive" onSelect={onDelete}>
Remove
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}| Option | Type | What it does |
|---|---|---|
| open? | boolean | |
| defaultOpen? | boolean | |
| onOpenChange? | (open: boolean) => void | |
| modal? | boolean |
| Part | What it is |
|---|---|
| DropdownMenuTrigger | The button that opens the menu |
| DropdownMenuContent | The menu's panel (role="menu") |
| DropdownMenuPortal | The portal a menu's panel goes through (DropdownMenuContent and DropdownMenuSubContent write their own) |
| DropdownMenuGroup | A group of rows inside a menu's panel, as role="group" |
| DropdownMenuShortcut | A row's key hint |
| DropdownMenuDescription | A row's caption |
| DropdownMenuItem | One row (role="menuitem") |
| DropdownMenuCheckboxItem | A row that turns a setting on or off (role="menuitemcheckbox") |
| DropdownMenuRadioGroup | A choice of one among its rows (role="group", named by its aria-label) |
| DropdownMenuRadioItem | One row of a DropdownMenuRadioGroup (role="menuitemradio") |
| DropdownMenuSeparator | A hairline between two groups of rows (role="separator"), the panel's full width |
| DropdownMenuLabel | A heading over a group of rows |
| DropdownMenuSub | A sub menu's root |
| DropdownMenuSubTrigger | The row that opens a sub menu |
| DropdownMenuSubContent | A sub menu's panel (role="menu"), the menu's own, beside its row and 4 px off the menu's panel (7 px off the row), its first row level with that row (3 px up, the panel's own inset); near the window's edge it flips to the row's other side and stays 8 px inside |
A row that turns a setting on or off (role="menuitemcheckbox").
import { DropdownMenuCheckboxItem } from '@/components/ui/goop/dropdown-menu';The menu's panel (role="menu").
import { DropdownMenuContent } from '@/components/ui/goop/dropdown-menu';<body> when left out.A row's caption.
import { DropdownMenuDescription } from '@/components/ui/goop/dropdown-menu';A group of rows inside a menu's panel, as role="group".
import { DropdownMenuGroup } from '@/components/ui/goop/dropdown-menu';One row (role="menuitem").
import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';A heading over a group of rows.
import { DropdownMenuLabel } from '@/components/ui/goop/dropdown-menu';The portal a menu's panel goes through (DropdownMenuContent and DropdownMenuSubContent write their own).
import { DropdownMenuPortal } from '@/components/ui/goop/dropdown-menu';A choice of one among its rows (role="group", named by its aria-label).
import { DropdownMenuRadioGroup } from '@/components/ui/goop/dropdown-menu';One row of a DropdownMenuRadioGroup (role="menuitemradio").
import { DropdownMenuRadioItem } from '@/components/ui/goop/dropdown-menu';A hairline between two groups of rows (role="separator"), the panel's full width.
import { DropdownMenuSeparator } from '@/components/ui/goop/dropdown-menu';A row's key hint.
import { DropdownMenuShortcut } from '@/components/ui/goop/dropdown-menu';A sub menu's panel (role="menu"), the menu's own, beside its row and 4 px off the menu's panel (7 px off the row), its first row level with that row (3 px up, the panel's own inset); near the window's edge it flips to the row's other side and stays 8 px inside.
import { DropdownMenuSubContent } from '@/components/ui/goop/dropdown-menu';<body> when left out.The row that opens a sub menu.
import { DropdownMenuSubTrigger } from '@/components/ui/goop/dropdown-menu';A sub menu's root.
import { DropdownMenuSub } from '@/components/ui/goop/dropdown-menu';The button that opens the menu.
import { DropdownMenuTrigger } from '@/components/ui/goop/dropdown-menu';| Key | What it does |
|---|---|
| Enter | On the trigger: open, the first row active |
| Space | On the trigger: open, the first row active |
| ArrowDown ArrowUp | Open from the trigger; move the active row |
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.
npx shadcn@4.23.1 add @goop/meadow-dropdown-menuGoop makes design skills and React components for AI coding agents, so every screen your agent builds matches.