Skip to content
العربية
Overlays

ContextMenu

A right-click menu for an area. Offer the same actions somewhere visible too.

import { ContextMenu } from "@percentsa/ui";

Examples

Right-click here
Code
export function ContextMenuExample() {
  const t = useT();
  return (
    <ContextMenu items={[{ label: t("Open", "فتح") }, { label: t("Copy link", "نسخ الرابط") }, "separator", { label: t("Archive", "أرشفة") }]}>
      <div className="grid h-36 w-72 place-items-center rounded-card border border-dashed border-line-strong text-sm text-fg-3">
        {t("Right-click here", "انقر بالزر الأيمن هنا")}
      </div>
    </ContextMenu>
  );
}