Skip to main content

contextMenu

caution

All props/parameters are optional unless they are marked with an asterisk ( * ).

tip

It is highly recommended to use this module together with the ContextMenu component.

Functions

NameParametersReturn TypeDescription
closevoidCloses the current context menu
open* event: MouseEvent
render: (props: ContextMenuProps) => ReactNode
options: ContextMenusOptions
renderLazy: Promise<(props: ContextMenuProps) => ReactNode)>
voidOpens a context menu
openLazy* event: MouseEvent
renderLazy: Promise<(props: ContextMenuProps) => ReactNode)>
options: ContextMenusOptions
voidOpens a lazy loaded context menu

Types

ContextMenuProps

NameTypeDefaultDescription
classNamestringComponent class name
configContextMenusOptionsOptions used for that context menu
contextstringAPPApp context
onHeightUpdate() => voidFunction ran to update the position
positionTooltip.PositionsContext menu position
targetHTMLElementContext menu children element
themestringCurrent theme

ContextMenusOptions

NameTypeDefaultDescription
alignTooltip.AlignsContext menu alignment to the children; works together with position
enableSpellCheckbooleanfalseWhether to enable spell checking
impressionNamestringImpression name for analytics
impressionPropertiesImpressionPropertiesImpression properties for analytics
onClose() => voidFunction ran when the context menu got closed
positionTooltip.PositionsContext menu position; works together with align