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
Name | Parameters | Return Type | Description |
---|---|---|---|
close | void | Closes the current context menu | |
open | * event : MouseEvent render : (props: ContextMenuProps ) => ReactNode options : ContextMenusOptions renderLazy : Promise<(props: ContextMenuProps ) => ReactNode)> | void | Opens a context menu |
openLazy | * event : MouseEvent renderLazy : Promise<(props: ContextMenuProps ) => ReactNode)> options : ContextMenusOptions | void | Opens a lazy loaded context menu |
Types
ContextMenuProps
Name | Type | Default | Description |
---|---|---|---|
className | string | Component class name | |
config | ContextMenusOptions | Options used for that context menu | |
context | string | APP | App context |
onHeightUpdate | () => void | Function ran to update the position | |
position | Tooltip.Positions | Context menu position | |
target | HTMLElement | Context menu children element | |
theme | string | Current theme |
ContextMenusOptions
Name | Type | Default | Description |
---|---|---|---|
align | Tooltip.Aligns | Context menu alignment to the children; works together with position | |
enableSpellCheck | boolean | false | Whether to enable spell checking |
impressionName | string | Impression name for analytics | |
impressionProperties | ImpressionProperties | Impression properties for analytics | |
onClose | () => void | Function ran when the context menu got closed | |
position | Tooltip.Positions | Context menu position; works together with align |