Installation
Basic Usage
Vanilla JavaScript
React
Vue
Configuration Options
The DOM element that contains your menu.Default:
nullThe plugin key for the bubble menu.Default:
'bubbleMenu'The delay in milliseconds before the menu position should be updated. This can be useful to prevent performance issues.Default:
250The delay in milliseconds before the menu position should be updated on window resize.Default:
60A function that determines whether the menu should be shown or not. If this function returns
false, the menu will be hidden, otherwise it will be shown.Parameters:editor: The editor instanceelement: The menu elementview: The ProseMirror EditorViewstate: The current editor stateoldState: The previous editor state (optional)from: Selection start positionto: Selection end position
The DOM element to append your menu to. Sometimes the menu needs to be appended to a different DOM context due to accessibility, clipping, or z-index issues.Default: Editor’s parent element
A function that returns the virtual element for the menu. This is useful when the menu needs to be positioned relative to a specific DOM element.
Configuration options passed to Floating UI for positioning. See Floating UI documentation for full details.Properties:
Positioning strategy.Default:
'absolute'Menu placement relative to selection. Options:
'top', 'right', 'bottom', 'left', 'top-start', 'top-end', 'right-start', 'right-end', 'bottom-start', 'bottom-end', 'left-start', 'left-end'Default: 'top'Distance in pixels from the selection.Default:
8Whether to flip the menu to the opposite side if there’s not enough space.Default:
{}Whether to shift the menu along the axis to keep it in view.Default:
{}The scrollable element that should be listened to when updating the position of the bubble menu.Default:
windowCallback fired when the menu is shown.
Callback fired when the menu is hidden.
Callback fired when the menu position is updated.
Callback fired when the menu is destroyed.
React Component Props
When using the React component, you can pass these props:The editor instance. Can be omitted if used inside
EditorProvider.The plugin key.Default:
'bubbleMenu'Update delay in milliseconds.
Resize delay in milliseconds.
Function to determine visibility.
Floating UI configuration options.
Vue Component Props
The editor instance.
The plugin key.Default:
'bubbleMenu'Update delay in milliseconds.
Resize delay in milliseconds.
Function to determine visibility.
Floating UI configuration options.
Element to append the menu to.
Function to get the virtual element for positioning.