Context Menu
interlace-ui/context-menuFreeComponent
Right-click / long-press menu. Wraps `@base-ui/react/context-menu` (same Menu compositional API as DropdownMenu, just with a Root that handles right-click / long-press / Shift+F10 as the open gesture).
Install it
npx shadcn@latest add https://ds.interlace.tools/r/context-menu.jsonSource
1'use client';23import * as React from 'react';45// @interlace/context-menu v1.1.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/context-menu7// What changed since: https://ds.interlace.tools/c/context-menu#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — ContextMenu12 *13 * Right-click / long-press menu. Wraps `@base-ui/react/context-menu`14 * (same Menu compositional API as DropdownMenu, just with a Root that15 * handles right-click / long-press / Shift+F10 as the open gesture).16 *17 * For the standard click-button-to-open pattern, use `DropdownMenu`.18 * Use ContextMenu only when consumers expect a true OS-level19 * right-click affordance (file lists, editor canvases, image grids).20 *21 * ## Anatomy22 *23 * ContextMenu (Root — Base UI manager)24 * ├─ ContextMenuTrigger (the right-clickable surface)25 * └─ ContextMenuContent (wraps Portal + Positioner + Popup26 * internally — do NOT nest it in27 * ContextMenuPortal, that portals twice)28 * ├─ ContextMenuGroup → ContextMenuLabel + ContextMenuItem29 * ├─ ContextMenuItem30 * ├─ ContextMenuSeparator31 * ├─ ContextMenuCheckboxItem32 * └─ ContextMenuRadioGroup → ContextMenuRadioItem33 *34 * `ContextMenuPortal` is exported only for the `container=` override (render35 * the popup into a specific node instead of `document.body`); it is not part36 * of the normal tree. `ContextMenuLabel` is `Menu.GroupLabel` and MUST sit37 * inside a `ContextMenuGroup` — outside one it throws on open.38 *39 * ## MIN_VIEWPORT — 32040 *41 * Long-press support works at every viewport.42 *43 * | Rule | Concept | Where in this file |44 * | ---- | -------------------------------- | ----------------------------------------------------------- |45 * | R4 | Extends Base UI part props | Each wrapper extends `React.ComponentProps<typeof BaseContextMenu.X>` |46 * | R6 | data-slot per part | `data-slot="context-menu-*"` |47 * | R7 | className merged + ...rest | `cn(BASE, className)` + `{...props}` |48 * | R13 | Ecosystem first | Wraps Base UI's context-menu — no bespoke right-click handling |49// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
