content/docs/examples/export.mdx
This example exports the current Plate editor value from the browser. The
registry export-toolbar-button owns the client-side download menu for HTML,
PDF, image, Markdown, and Word output.
Install the Export Toolbar Button component to add the menu to an editor toolbar.
<ComponentSource name="export-toolbar-button" />| Format | Implementation | Output |
|---|---|---|
| HTML | serializeHtml from platejs/static with BaseEditorKit and EditorStatic | plate.html |
html2canvas-pro snapshot converted with pdf-lib | plate.pdf | |
| Image | html2canvas-pro snapshot | plate.png |
| Markdown | editor.getApi(MarkdownPlugin).markdown.serialize() | plate.md |
| Word | exportToDocx(editor.children, { editorPlugins }) from @platejs/docx-io | plate.docx |
The PDF and image exporters snapshot the current editable DOM. Use them for a quick client-side download, not for paginated print layout.
Word export passes the base static editor kit plus DocxExportKit so custom
nodes can render with DOCX-friendly components.
DocxExportKit overrides code blocks, columns, equations, callouts, and table
of contents rendering for the DOCX conversion path.
Plate Plus includes a server-side export flow for PDF output with page settings.
<ComponentPreviewPro name="export-pro" />@platejs/docx-io options and plugin APIs.