EmailNode extends TipTap’s Node class with an additional renderToReactEmail() method
that controls how the node is serialized when exporting to email HTML via
composeReactEmail.
Import
EmailNode.create
Create a new email-compatible node from scratch.renderToReactEmail method.
renderToReactEmail props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode | The serialized child content of this node |
style | React.CSSProperties | Resolved theme styles for this node (empty object if no theme) |
node | Node | The ProseMirror node instance |
extension | EmailNode | The extension instance, useful for accessing options |
EmailNode.from
Wrap an existing TipTap node with email serialization support. This is useful when you want to reuse a community TipTap extension and add email export support without rewriting it.renderToReactEmail renderer component. It receives the same props
as described above.
.configure
Configure options on anEmailNode (same as TipTap’s .configure()):
.extend
Extend anEmailNode with additional behavior:
renderToReactEmail when extending:
See also
- Custom Extensions — tutorial on building custom nodes
EmailMark— the equivalent class for inline markscomposeReactEmail— the function that callsrenderToReactEmail