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

Context menu

Pro

A menu of a target's secondary actions, opened at the pointer, for React and Tailwind CSS. Part of Goop Pro.

This part takes no options of its own: it is set by what you put in it.

When to use

  • A menu of a target's secondary actions, opened at the pointer.
  • Also called: right-click 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 Context 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>/meadow-context-menu.json --yes
PROMPT
Add the Goop Context menu to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import {
  ContextMenuPortal, ContextMenuGroup, ContextMenuLabel, ContextMenuShortcut, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub,
  ContextMenuSubTrigger, ContextMenuSubContent,
} from '@/components/ui/goop/context-menu';

import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuTrigger,
} from '@/components/ui/goop/context-menu';
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger,
} from '@/components/ui/goop/dropdown-menu';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';

const ACTIONS = [
  { id: 'share', words: 'Copy link' },
  { id: 'delete', words: 'Delete note' },
];

function NoteRow({ onAction }: { onAction: (id: string) => void }) {
  return (
    <ContextMenu>
      <ContextMenuTrigger asChild>
        <div>
          Ridge transect
          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <IconButton aria-label="Note actions">
                <IconButtonIcon icon="ellipsis" />
              </IconButton>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              {ACTIONS.map((a) => (
                <DropdownMenuItem key={a.id} onSelect={() => onAction(a.id)}>
                  {a.words}
                </DropdownMenuItem>
              ))}
            </DropdownMenuContent>
          </DropdownMenu>
        </div>
      </ContextMenuTrigger>
      <ContextMenuContent>
        {ACTIONS.map((a) => (
          <ContextMenuItem key={a.id} onSelect={() => onAction(a.id)}>
            {a.words}
          </ContextMenuItem>
        ))}
      </ContextMenuContent>
    </ContextMenu>
  );
}
  • Fits: list, board: row.
  • Also known as: Right-click menu, Long-press menu, Row actions menu.
  • Never put an action in the context menu alone: a right-click, a long press and Shift+F10 are all hidden. Pair it with a visible more-actions IconButton opening a DropdownMenu of the same rows: one array mapped into both.

API reference

Parts
PartWhat it is
ContextMenuTriggerThe area that opens the menu
ContextMenuPortalThe portal a menu's content goes through (ContextMenuContent writes its own)
ContextMenuContentThe menu's panel (role="menu", named by aria-label), its corner at the pointer; by the keys, below the row (above it when the room is short)
ContextMenuGroupA group of rows (role="group"), named by a ContextMenuLabel inside it
ContextMenuLabelA heading over a group of rows
ContextMenuShortcutA row's key hint
ContextMenuItemOne row (role="menuitem")
ContextMenuCheckboxItemA row that turns a setting on or off (role="menuitemcheckbox")
ContextMenuRadioGroupA choice of one among its rows
ContextMenuRadioItemOne row of a ContextMenuRadioGroup (role="menuitemradio")
ContextMenuSeparatorA hairline between two groups of rows (role="separator"), the panel's full width
ContextMenuSubA sub menu's root
ContextMenuSubTriggerThe row that opens a sub menu
ContextMenuSubContentA sub menu's panel (role="menu"), the menu's skin, beside its row at its inline end and 4 px off the menu's panel (7 px off the row, the dropdown menu's sub menu's gap), its first row level with that row (3 px up, the panel's own inset)

ContextMenuCheckboxItem

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

TSX
import { ContextMenuCheckboxItem } from '@/components/ui/goop/context-menu';

Options

  • icon?: IconName — A pack icon's name, drawn in the 16 px box before the row's words; left out, the row draws no icon.

ContextMenuContent

The menu's panel (role="menu", named by aria-label), its corner at the pointer; by the keys, below the row (above it when the room is short).

TSX
import { ContextMenuContent } from '@/components/ui/goop/context-menu';

Options

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

ContextMenuGroup

A group of rows (role="group"), named by a ContextMenuLabel inside it.

TSX
import { ContextMenuGroup } from '@/components/ui/goop/context-menu';

Options

ContextMenuItem

One row (role="menuitem").

TSX
import { ContextMenuItem } from '@/components/ui/goop/context-menu';

Options

  • icon?: IconName — A pack icon's name, drawn in the 16 px box before the row's words; left out, the row draws no icon.
  • variant?: 'default' | 'destructive' = 'default' — destructive: the row that deletes or cannot be undone — the dropdown menu's red row: its words in the theme's red, its icon in the lighter coral, a pale red wash under the pointer and the keys; it picks, closes and fades when disabled as any row.

ContextMenuLabel

A heading over a group of rows.

TSX
import { ContextMenuLabel } from '@/components/ui/goop/context-menu';

Options

ContextMenuPortal

The portal a menu's content goes through (ContextMenuContent writes its own).

TSX
import { ContextMenuPortal } from '@/components/ui/goop/context-menu';

Options

ContextMenuRadioGroup

A choice of one among its rows.

TSX
import { ContextMenuRadioGroup } from '@/components/ui/goop/context-menu';

Options

ContextMenuRadioItem

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

TSX
import { ContextMenuRadioItem } from '@/components/ui/goop/context-menu';

Options

  • icon?: IconName — A pack icon's name, drawn in the 16 px box before the row's words; left out, the row draws no icon.

ContextMenuSeparator

A hairline between two groups of rows (role="separator"), the panel's full width.

TSX
import { ContextMenuSeparator } from '@/components/ui/goop/context-menu';

Options

ContextMenuShortcut

A row's key hint.

TSX
import { ContextMenuShortcut } from '@/components/ui/goop/context-menu';

Options

ContextMenuSubContent

A sub menu's panel (role="menu"), the menu's skin, beside its row at its inline end and 4 px off the menu's panel (7 px off the row, the dropdown menu's sub menu's gap), its first row level with that row (3 px up, the panel's own inset).

TSX
import { ContextMenuSubContent } from '@/components/ui/goop/context-menu';

Options

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

ContextMenuSubTrigger

The row that opens a sub menu.

TSX
import { ContextMenuSubTrigger } from '@/components/ui/goop/context-menu';

Options

  • icon?: IconName — A pack icon's name, drawn in the 16 px box before the row's words; left out, the row draws no icon.

ContextMenuSub

A sub menu's root.

TSX
import { ContextMenuSub } from '@/components/ui/goop/context-menu';

Options

ContextMenuTrigger

The area that opens the menu.

TSX
import { ContextMenuTrigger } from '@/components/ui/goop/context-menu';

Options

  • Also takes: asChild?: boolean

Keyboard

KeyWhat it does
Shift+F10 ContextMenuOn the focused target: open the menu just below its row at its start edge (above the row where the room below is short), the first row lit, the browser's own menu kept shut
ArrowDown ArrowUpMove the lit row, skipping a disabled one
Home EndFirst or last row

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write 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.

goop.so/themes/meadow/components/context-menu.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-context-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.