reablocks
Version:
Component library for React
44 lines (42 loc) • 1.16 kB
TypeScript
import { ContextMenuTheme } from './ContextMenuTheme';
import { ConnectedOverlayProps } from '../../utils';
import { FC, ReactNode } from 'react';
export interface ContextMenuContentProps {
close: () => void;
closeAll: () => void;
}
export interface ContextMenuProps extends Omit<ConnectedOverlayProps, 'open'> {
/**
* Child element to trigger the context menu.
*/
children: ReactNode;
/**
* Content to show in the context menu.
*/
content: any | ((args: any) => ReactNode);
/**
* Whether the context menu is disabled.
*/
disabled?: boolean;
/**
* Whether the context menu should autofocus on open.
*/
autofocus?: boolean;
/**
* Whether the context menu should close on click.
*/
autoClose?: boolean;
/**
* Class name to apply to the trigger element.
*/
triggerClassName?: string;
/**
* Class name to apply to the trigger when the context menu is open.
*/
triggerOpenClassName?: string;
/**
* Theme for the Context Menu.
*/
theme?: ContextMenuTheme;
}
export declare const ContextMenu: FC<ContextMenuProps>;