Skip to main content

Creating a custom node

Custom extensions use EmailNode, which extends TipTap’s Node with one extra required method: renderToReactEmail(). Use parseHTML() to recognize pasted or imported HTML, renderHTML() to control how the node appears in the editor, and renderToReactEmail() to control how it is exported by composeReactEmail. Here’s a complete example of a custom “Callout” node that renders as a highlighted block:

Registering the extension

Add your custom extension to the extensions array alongside StarterKit:

Inserting custom nodes

Use the editor’s insertContent command to programmatically insert your custom node:

Complete example

Here’s the full editor setup with the custom Callout extension, a toolbar, and a bubble menu:

Wrapping existing TipTap extensions

Both EmailNode and EmailMark provide a .from() method that wraps an existing TipTap extension with email serialization support. This is useful when you want to reuse a community TipTap extension and add email export support without rewriting it.
For full API details on all methods (create, from, configure, extend), see the EmailNode and EmailMark reference pages.

Configure and extend

Both EmailNode and EmailMark support TipTap’s standard customization methods:

Examples

See custom extensions in action with a runnable example:

Custom Extensions

Custom Callout node with EmailNode.create, toolbar insertion, and bubble menu.