Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-dropdown-menu

Dropdown menu

Free

A menu of actions, for React and Tailwind CSS. Free, MIT.

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.

When to use

  • A menu of actions.
  • Also called: dropdown or actions menu.

When not to use

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 Dropdown menu on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-dropdown-menu
PROMPT
Add the Goop Dropdown menu to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import {
  menuSkin, DropdownMenu, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuShortcut, DropdownMenuItem, DropdownMenuCheckboxItem,
  DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent,
} from '@/components/ui/goop/dropdown-menu';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';

<DropdownMenu>
  <DropdownMenuTrigger asChild>
    <IconButton variant="ghost" aria-label="Note actions">
      <IconButtonIcon icon="dots" />
    </IconButton>
  </DropdownMenuTrigger>
  <DropdownMenuContent aria-label="Note actions">
    <DropdownMenuItem>Rename</DropdownMenuItem>
    <DropdownMenuItem>Duplicate</DropdownMenuItem>
    <DropdownMenuSeparator />
    <DropdownMenuCheckboxItem checked>Pinned</DropdownMenuCheckboxItem>
  </DropdownMenuContent>
</DropdownMenu>
  • Fits: account, list (their recipes).
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
open?boolean
defaultOpen?boolean
onOpenChange?(open: boolean) => void
modal?boolean
  • Another example of it: menu-button.md
  • State: open (open / defaultOpen / onOpenChange); drawn by data-state=unchecked, data-state=open, data-highlighted, data-disabled
Parts
PartWhat it is
DropdownMenuTriggerThe button that opens the menu; takes asChild
DropdownMenuPortalThe portal a menu's content goes through (DropdownMenuContent writes its own)
DropdownMenuContentThe menu's panel (role="menu"), placed below its trigger at its start, 4 px off, shifting and flipping to stay 8 px inside the window (collisionPadding); it portals to the end of <body>, or into container; its props: dropdown-menu--content.md
DropdownMenuGroupA group of rows (role="group"), named by a DropdownMenuLabel inside it
DropdownMenuLabelA heading over a group of rows
DropdownMenuShortcutA row's key hint
DropdownMenuItemOne row (role="menuitem"); its props: dropdown-menu--item.md
DropdownMenuCheckboxItemA row that turns a setting on or off (role="menuitemcheckbox"); its props: dropdown-menu--checkbox-item.md
DropdownMenuRadioGroupA choice of one among its rows; also takes value?: string; onValueChange?: (value: string) => void
DropdownMenuRadioItemOne row of a DropdownMenuRadioGroup (role="menuitemradio"); its props: dropdown-menu--radio-item.md
DropdownMenuSeparatorA line between groups of rows (role="separator")
DropdownMenuSubA sub menu's root; also takes open?: boolean; defaultOpen?: boolean = false; onOpenChange?: (open: boolean) => void
DropdownMenuSubTriggerThe row that opens a sub menu; its props: dropdown-menu--sub-trigger.md
DropdownMenuSubContentA sub menu's panel (role="menu"), the menu's skin, beside its row, its first row level with it (flipped to the row's other side near the window's edge, still level)
menuSkinThe theme's internal skin table, not a component

DropdownMenuCheckboxItem

A row that turns a setting on or off (role="menuitemcheckbox").

TSX
import { DropdownMenuCheckboxItem } from '@/components/ui/goop/dropdown-menu';

Options

  • icon?: IconName — A pack icon's name, in the 16 px box before the row's words.
  • Also takes: checked?: boolean | 'indeterminate'; onCheckedChange?: (checked: boolean) => void; disabled?: boolean

DropdownMenuContent

The menu's panel (role="menu"), placed below its trigger at its start, 4 px off, shifting and flipping to stay 8 px inside the window (collisionPadding); it portals to the end of <body>, or into container.

TSX
import { DropdownMenuContent } from '@/components/ui/goop/dropdown-menu';

Options

  • container?: HTMLElement | null — Where the layer is portalled; the end of <body> when left out.

DropdownMenuItem

One row (role="menuitem").

TSX
import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';

Options

  • icon?: IconName — A pack icon's name, in the 16 px box before the row's words.
  • variant?: 'default' | 'destructive' = 'default' — destructive: the row that deletes or cannot be undone — its words, icon and wash in the theme's red.
  • Also takes: asChild?: boolean; onSelect?: (event: Event) => void; disabled?: boolean

DropdownMenuRadioItem

One row of a DropdownMenuRadioGroup (role="menuitemradio").

TSX
import { DropdownMenuRadioItem } from '@/components/ui/goop/dropdown-menu';

Options

  • icon?: IconName — A pack icon's name, in the 16 px box before the row's words.
  • Also takes: value: string; disabled?: boolean

DropdownMenuSubTrigger

The row that opens a sub menu.

TSX
import { DropdownMenuSubTrigger } from '@/components/ui/goop/dropdown-menu';

Options

  • icon?: IconName — A pack icon's name, in the 16 px box before the row's words.
  • Also takes: disabled?: boolean

Keyboard

KeyWhat it does
EnterOn the trigger: open, the first row active
SpaceOn the trigger: open, the first row active
ArrowDown ArrowUpOpen from the trigger; move the active row

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write your own.

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

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/dropdown-menu.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-dropdown-menu

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.