Context Menu

CommandDate Picker

A menu of actions opened with a right-click.

Right-click here

Installation

pnpm add krz-ui

Usage

import { ContextMenu } from "krz-ui";
<ContextMenu
  items={[
    { label: "Copy", shortcut: "⌘C", onSelect: copy },
    { label: "Rename" },
    { type: "separator" },
    { label: "Delete", danger: true },
  ]}
>
  <div>Right-click here</div>
</ContextMenu>

API Reference

PropTypeDescription
childrenReactNodeThe area that opens the menu on right-click.
itemsDropdownMenuItem[]Same items as DropdownMenu: items, labels and separators.
disabledbooleanUse the browser's own menu instead.
className / style / ref—All go to the right-click area. Style the popup with classNames.menu. See Customization.
classNames{ menu?, item?, icon?, shortcut?, separator?, label? }Extra classes for inner parts.