Context Menu
octane/context-menuFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/context-menu.jsonSource
1// Base UI base context-menu — runs on @octanejs/base-ui's `ContextMenu`. Class strings from the2// maintainer-supplied radix source; every difference below was checked against rendered DOM.3//4// This is dropdown-menu's sibling and inherits its findings, WITH ONE IMPROVEMENT: `ContextMenu`5// ships a real `Separator` part, which `Menu` does not, so the separator is the primitive here6// rather than a plain host element. It emits `role="separator"`, `aria-orientation` and7// `data-orientation`.8//9// CARRIED OVER FROM dropdown-menu, all re-verified against this primitive:10// - Two CSS variables are renamed. Radix publishes per-component names; Base UI's Positioner11// publishes generic ones, and a utility naming a variable nothing sets does nothing, silently:12// --radix-context-menu-content-available-height -> --available-height13// --radix-context-menu-content-transform-origin -> --transform-origin14// - The submenu trigger marks itself open with `data-popup-open`, not the `data-open` the popup15// carries, so radix's `data-open:bg-accent` would leave an open submenu's parent row unstyled.16// - `Label` stays a plain `<div>`: `ContextMenu.GroupLabel` requires a `ContextMenu.Group`17// ancestor and throws without one, while shadcn's label is used standalone.18// - Radix's `focus:` item utilities carry over unchanged, because Base UI moves real DOM focus19// onto the highlighted item as well as publishing `data-highlighted`.20//21// POSITIONING PROPS GO TO THE POSITIONER, NOT THE POPUP. Radix has one `Content` element that takes22// them all; Base UI splits positioning into its own layer, so anything swept onto `Popup` by a rest23// spread is inert — `side="top"` would silently leave the menu on its default side and also land on24// the DOM as an invalid attribute. They are destructured and forwarded explicitly.25import { type OctaneNode } from 'octane';26import { ContextMenu as ContextMenuPrimitive } from '@octanejs/base-ui/context-menu';27import { CheckIcon, ChevronRightIcon } from '@octanejs/lucide';2829import { cn } from '@/lib/utils';3031type Props = { className?: string; children?: OctaneNode } & Record<string, unknown>;3233export interface BaseUiPositioningProps {34 /** Forwarded to the Positioner; see the note at the top of this file. */35 side?: 'top' | 'right' | 'bottom' | 'left';36 sideOffset?: number;37 align?: 'start' | 'center' | 'end';38 alignOffset?: number;39 anchor?: unknown;40 positionMethod?: 'absolute' | 'fixed';41// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
