Context menu
EuiContextMenu is a nested menu system useful for navigating complicated trees. It lives within an EuiPopover which itself can be wrapped around any component (like a button in this example).
With single panel
Use EuiContextMenuPanel for simple, non-nested context menus. The below pagination example has no nesting and no title.
Accessibility recommendation
The selected context menu item should receive the aria-current="true" attribute, which tells screen readers which item is selected.
With scrollable panel
You can set a fixed height for the context menu panel via the height prop to make the panel scrollable.
This can be done both on EuiContextMenu or a standalone EuiContextMenuPanel directly. When height is set,the title and any content outside of the scrollable area remain static while the items are scrollable.
Displaying custom elements
If you have custom content to show instead of a list of options, you can pass a React element as a child to EuiContextMenuPanel.
Using panels with mixed items & content
Custom panels
Context menu panels can be passed React elements through the content prop instead of items. The panel will display your custom content without modification.
If your panel contents have different widths or you need to ensure that a specific context menu panel has a certain width, add width: [number of pixels] to the panel tree.
Custom items
You can add separator lines in the items prop if you define an item as {isSeparator: true}. This will pass the rest of the object properties to an EuiHorizontalRule component.
For completely custom rendered items, you can use the {renderItem} property to pass a component or any function that returns a JSX node.