Oros UI

Search documentation

Search Oros UI pages and components.

Context Menu

Shows actions for an item from a right-click or long-press.

Right click here

Installation

Install Context Menu from Oros with shadcn CLI 4.13.0.

pnpm dlx shadcn@4.13.0 add @oros/context-menu

Usage

import {
  ContextMenu,
  ContextMenuTrigger,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuCheckboxItem,
  ContextMenuRadioItem,
} from "@/components/ui/context-menu"

Open the Source tab in the preview for a complete working example.

Anatomy

ExportResponsibility
ContextMenuThe root component that owns the primary structure and state.
ContextMenuTriggerControls opening, selection, or disclosure behavior.
ContextMenuContentContains the primary visible content.
ContextMenuItemRepresents one option or repeated child.
ContextMenuCheckboxItemRepresents one option or repeated child.
ContextMenuRadioItemRepresents one option or repeated child.
ContextMenuLabelProvides a visible label for its related control or value.
ContextMenuSeparatorVisually and semantically separates related groups.
ContextMenuShortcutA composable part of the component anatomy.
ContextMenuGroupGroups related items into one logical set.
ContextMenuPortalMoves overlay content to a stable document layer.
ContextMenuSubA composable part of the component anatomy.
ContextMenuSubContentContains the primary visible content.
ContextMenuSubTriggerControls opening, selection, or disclosure behavior.
ContextMenuRadioGroupGroups related items into one logical set.

API Reference

Context Menu exports 15 named entries. Component exports accept the props of their underlying HTML element or Base UI component, plus an optional className, unless the source defines a more focused type.

  • ContextMenu Component
  • ContextMenuTrigger Component
  • ContextMenuContent Component
  • ContextMenuItem Component
  • ContextMenuCheckboxItem Component
  • ContextMenuRadioItem Component
  • ContextMenuLabel Component
  • ContextMenuSeparator Component
  • ContextMenuShortcut Component
  • ContextMenuGroup Component
  • ContextMenuPortal Component
  • ContextMenuSub Component
  • ContextMenuSubContent Component
  • ContextMenuSubTrigger Component
  • ContextMenuRadioGroup Component

Accessibility

  • Context Menu inherits focus management and keyboard support from Base UI; keep the provided trigger and content parts together.
  • Give icon-only triggers an accessible name, retain visible focus styles, and verify Escape and focus-return behavior in the final composition.

Source

Context Menu uses the standard shadcn API and is distributed through Oros. Installing it adds the component source and required dependencies to your app. The Source tab above shows a complete usage example.