Back to Plate

Export

content/docs/examples/export.mdx

53.0.81.8 KB
Original Source

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.

Demo

<ComponentPreview name="playground-demo" id="basic-blocks" />

Toolbar Source

Install the Export Toolbar Button component to add the menu to an editor toolbar.

<ComponentSource name="export-toolbar-button" />

Export Formats

FormatImplementationOutput
HTMLserializeHtml from platejs/static with BaseEditorKit and EditorStaticplate.html
PDFhtml2canvas-pro snapshot converted with pdf-libplate.pdf
Imagehtml2canvas-pro snapshotplate.png
Markdowneditor.getApi(MarkdownPlugin).markdown.serialize()plate.md
WordexportToDocx(editor.children, { editorPlugins }) from @platejs/docx-ioplate.docx

The PDF and image exporters snapshot the current editable DOM. Use them for a quick client-side download, not for paginated print layout.

DOCX Static Kit

Word export passes the base static editor kit plus DocxExportKit so custom nodes can render with DOCX-friendly components.

<ComponentSource name="docx-export-kit" />

DocxExportKit overrides code blocks, columns, equations, callouts, and table of contents rendering for the DOCX conversion path.

Plus Export

Plate Plus includes a server-side export flow for PDF output with page settings.

<ComponentPreviewPro name="export-pro" />