Quick start
AddBubbleMenu as a child of EditorProvider to get a fully-featured formatting toolbar.
BubbleMenu has no children, it renders the default text formatting toolbar automatically.
Hiding on specific nodes or marks
Prevent the bubble menu from appearing on certain node types or when certain marks are active.BubbleMenu.
Composing from primitives
For full control, build a custom bubble menu using the compound component API.BubbleMenu wraps everything, BubbleMenu.ItemGroup creates visual groupings,
and individual items render the toggle buttons.
Available items
| Component | Description |
|---|---|
BubbleMenu.Bold | Bold toggle |
BubbleMenu.Italic | Italic toggle |
BubbleMenu.Underline | Underline toggle |
BubbleMenu.Strike | Strikethrough toggle |
BubbleMenu.Code | Inline code toggle |
BubbleMenu.Uppercase | Uppercase toggle |
BubbleMenu.AlignLeft | Left alignment |
BubbleMenu.AlignCenter | Center alignment |
BubbleMenu.AlignRight | Right alignment |
BubbleMenu.NodeSelector | Block type dropdown (paragraph, h1-h3, etc.) |
BubbleMenu.LinkSelector | Link add/edit popover |
BubbleMenu.Separator | Visual separator between groups |
Placement and offset
Control where the bubble menu appears relative to the selection.Whether the menu appears above or below the selection.
Distance from the selection in pixels.
Examples
See bubble menus in action with runnable examples:Bubble Menu
Default bubble menu with text selection.
Custom Bubble Menu
Composing a custom menu from primitives.