ContextMenuProps interface

Signature

  1. export interface ContextMenuProps

Import

  1. import { ContextMenuProps } from '@grafana/ui';

Properties

PropertyTypeDescription
focusOnOpenbooleanOn menu open focus the first element
onClose() => voidCallback for closing the menu
renderHeader() => React.ReactNodeA function that returns header element
renderMenuItems() => React.ReactNodeRenderProp function that returns menu items to display
xnumberStarting horizontal position for the menu
ynumberStarting vertical position for the menu

focusOnOpen property

On menu open focus the first element

Signature

  1. focusOnOpen?: boolean;

onClose property

Callback for closing the menu

Signature

  1. onClose?: () => void;

renderHeader property

A function that returns header element

Signature

  1. renderHeader?: () => React.ReactNode;

renderMenuItems property

RenderProp function that returns menu items to display

Signature

  1. renderMenuItems?: () => React.ReactNode;

x property

Starting horizontal position for the menu

Signature

  1. x: number;

y property

Starting vertical position for the menu

Signature

  1. y: number;