‹ components

ContextMenu

draftv0.9.0·open in canvas

Right-click / long-press menu — Menu's context sibling on Radix ContextMenu.

Installnpx shadcn add @cids/context-menu
Live demo
Right-click this surface

Motion · tap to replay

honors reduced-motion

Panel: `data-[state=open]:fade-in` via Radix presets. Item highlight is instant (keyboard/pointer tracking).

Brand chip remounts on tap · highlighted tokens are named in this component's doc · spring is budgeted to human feedback only.

import { ContextMenu } from "@/design-system";

<ContextMenu
  items={[
    { label: "Copy address", onSelect: copy },
    { label: "View on explorer", onSelect: open },
    { kind: "separator" },
    { label: "Remove", onSelect: remove, destructive: true },
  ]}
>
  <div className="rounded-card border p-4">Right-click this row</div>
</ContextMenu>

Tokens · live

Resolves in the active theme — flip the toggle above to verify.

States · from doc

Parsed from the doc. Interact with the live demo for hover/active.

closedopenitem highlighteditem disableddestructive item.

Right-click / long-press menu — Menu's context sibling on Radix ContextMenu.

Anatomy

┌ wrapped surface ─────────────┐
│  (right-click / long-press)  │
└──────────────┬───────────────┘
               ▼ at pointer
        ┌ Copy address   ┐
        │ View explorer  │
        │ ────────────── │
        │ Remove         │ ← destructive: sell ink
        └────────────────┘

Props

PropTypeDefaultNotes
childrenReactNoderequiredTrigger surface; rendered asChild — pass one element.
itemsMenuItem[]requiredSame shape as Menu (label/onSelect/destructive?/disabled? or separator).
classNamestring—cn-merged onto the panel.

"use client" — Radix ContextMenu.

Motion

Panel: data-[state=open]:fade-in via Radix presets. Item highlight

is instant (keyboard/pointer tracking).

A11y

Radix ContextMenu: arrow keys, typeahead, Escape, outside dismiss,

focus return. Destructive items use sell ink and the word (never

color alone). On touch, Radix maps long-press; still offer a visible

Menu on dense mobile UIs where long-press isn't discoverable.

Self-contained: copy the folder into any Tailwind+React app, or use the install command above. Docs and this page render the same file on disk — they cannot drift.