react-global-context-menu
Version:
A lightweight global context menu for React apps
20 lines (19 loc) • 575 B
TypeScript
import { ReactNode } from "react";
export interface MenuItem {
key: string;
name?: string | ReactNode;
className?: string;
onClick?: () => void;
disabled?: boolean;
type?: "menu" | "divider";
show?: boolean;
icon?: ReactNode;
shortcut?: string;
}
export declare const useGlobalContextMenu: () => {
openContextMenu: (x: number, y: number, menus: MenuItem[]) => void;
closeContextMenu: () => void;
};
export declare const ContextMenuProvider: ({ children, }: {
children: ReactNode;
}) => import("react/jsx-runtime").JSX.Element;