Context Menu

Displays a menu of actions triggered by a right click.

About

Context Menu is built with the help of Menu from Material CDK and Dropdown Menu .

Installation

ng g @spartan-ng/cli:ui context-menu

Usage

import { HlmContextMenuImports } from '@spartan-ng/helm/context-menu';
import { HlmDropdownMenuImports } from '@spartan-ng/helm/dropdown-menu';
<div [hlmContextMenuTrigger]="menu">Right click here</div>

<ng-template #menu>
  <hlm-dropdown-menu>
    <hlm-dropdown-menu-group>
      <button hlmDropdownMenuItem>Profile</button>
      <button hlmDropdownMenuItem>Billing</button>
      <button hlmDropdownMenuItem>Team</button>
      <button hlmDropdownMenuItem>Subscription</button>
    </hlm-dropdown-menu-group>
  </hlm-dropdown-menu>
</ng-template>

Examples

Basic

Shortcuts

Icons

Destructive

Sides

Stateful

Unsaved Changes

RTL

To enable RTL support in spartan-ng, see the RTL configuration guide.

Helm API

HlmContextMenuTrigger

Selector: [hlmContextMenuTrigger]

Inputs

PropTypeDefaultDescription
disabled boolean this._cdkTrigger.disabled -
align MenuAlign this._config.align -
side MenuSide this._config.side -
Data Table Command