Skip to main content

Context Menu

The ContextMenu component displays a menu with actions or options triggered by user interaction.

Example

Structure

ContextMenu

PropDescriptionType
childrenThe menu content, including trigger and itemsReactNode

ContextMenuTrigger

PropDescriptionType
asChildRenders the trigger as a child elementBoolean
classNameCustom CSS classes for styling the triggerString

ContextMenuContent

PropDescriptionType
classNameCustom CSS classes for styling the contentString

ContextMenuList

PropDescriptionType
titleOptional title for the menu groupString
classNameCustom CSS classes for styling the listString

ContextMenuItem

PropDescriptionType
asChildRenders the item as a child elementBoolean
classNameCustom CSS classes for styling the itemString

Customization

The approach for customization will vary depending on if the customization is intended to be global for all consumers of the UI component or if it is only an override for a particular instance.

  • If the customization is necessary for all use cases, update the component source code in the UI library package directly.
  • Otherwise, pass className overrides. Class overrides can be applied to all sub-components.