Add BubbleMenu as a child of EditorProvider to get a fully-featured formatting toolbar.
import { StarterKit } from '@react-email/editor/extensions';import { BubbleMenu } from '@react-email/editor/ui';import { EditorProvider } from '@tiptap/react';import '@react-email/editor/themes/default.css';const extensions = [StarterKit];export function MyEditor() { return ( <EditorProvider extensions={extensions} content={content}> <BubbleMenu /> </EditorProvider> );}
Select text to see the toolbar with formatting, alignment, node type selection, and link controls.When BubbleMenu has no children, it renders the default text formatting toolbar automatically.
This is useful when combining the text bubble menu with contextual menus for links, images, or buttons — each gets its own menu via BubbleMenu.
import { BubbleMenu, bubbleMenuTriggers } from '@react-email/editor/ui';import { PluginKey } from '@tiptap/pm/state';const linkPluginKey = new PluginKey('linkBubbleMenu');<> {/* Hide text bubble menu on links and buttons -- their own menus handle those */} <BubbleMenu hideWhenActiveNodes={['button']} hideWhenActiveMarks={['link']} /> <BubbleMenu trigger={bubbleMenuTriggers.nodeWithoutSelection('link')} pluginKey={linkPluginKey} > <BubbleMenu.LinkToolbar> <BubbleMenu.LinkEditLink /> <BubbleMenu.LinkOpenLink /> <BubbleMenu.LinkUnlink /> </BubbleMenu.LinkToolbar> </BubbleMenu></>