Getting StartedInstallation and setup guides 5
LayoutWorkflow and structural layout components 7
OverlayModal and floating layer surfaces 3
FeedbackStatus, empty, progress, and loading placeholder patterns 5
FormInput and selection components 17
UtilityGeneral-purpose interface utilities 7
NavigationMenu surfaces and hierarchical actions 7

Context Menu overview

Context Menu layers right-click and keyboard context actions on top of menu primitives while keeping the trigger surface fully owner-controlled and exposing anchor state for owner-managed placement.

Imports

Use primitives for headless control, or the wrapper for default panel styling.

Primitive imports

ts
import {
  TngContextMenu,
  TngContextMenuTrigger,
  TngMenu,
  TngMenuItem,
} from '@tailng-ui/primitives';

Wrapper imports

ts
import { TngContextMenuComponent } from '@tailng-ui/components';
import { TngContextMenuTrigger, TngMenuItem } from '@tailng-ui/primitives';

Usage patterns

The exported tngContextMenu instance tracks whether the menu opened from a pointer or keyboard anchor. Use that state when you want true cursor-relative placement in headless builds; the wrapper only adds the minimum panel skin.

Headless usage

html
<div class="context-menu-shell context-menu-shell--anchored">
  <div tabindex="0" [tngContextMenuTrigger]="assetMenu">Right-click target</div>
  <div tngMenu tngContextMenu #assetMenu="tngContextMenu">
    <button type="button" tngMenuItem tngMenuItemValue="Rename">Rename</button>
    <button type="button" tngMenuItem tngMenuItemValue="Archive">Archive</button>
  </div>
</div>
<!-- Use assetMenu.getAnchorType() / getPointerAnchor() if you want cursor-relative placement. -->

Wrapper usage

html
<div class="context-menu-shell context-menu-shell--anchored">
  <div tabindex="0" [tngContextMenuTrigger]="assetMenu">Right-click target</div>
  <tng-context-menu #assetMenu="tngContextMenu" ariaLabel="Asset actions">
    <button type="button" tngMenuItem tngMenuItemValue="Rename">Rename</button>
    <button type="button" tngMenuItem tngMenuItemValue="Archive">Archive</button>
  </tng-context-menu>
</div>

Style variants

Same context-menu behavior rendered through plain CSS wrappers and Tailwind utility shells. These docs anchor the menu under each target for readability.

Wrapper actions (plain CSS)

last command: No command yet

Keyboard baseline

  • Shift + F10 or ContextMenu opens from focused target.
  • ArrowDown/ArrowUp traverses enabled actions.
  • Enter/Space activates the highlighted action.
  • Escape closes the menu and restores focus to the trigger target.