Export utilities provide functions for exporting shapes to various formats and copying them to the clipboard.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tldraw/tldraw/llms.txt
Use this file to discover all available pages before exploring further.
exportAs
Export shapes as downloadable files in various formats.The editor instance.
The IDs of the shapes to export.
Export options including format and name.
ExportAsOptions
The export format (e.g., ‘png’, ‘svg’, ‘jpeg’, ‘webp’, ‘json’).
Name of the exported file. If undefined, a predefined name based on the selection will be used.
Scale factor for the export. Defaults to 1.
Image quality from 0 to 1 (for formats that support it).
Padding around the exported shapes in pixels.
Whether to include the background.
Example
copyAs
Copy shapes to the clipboard in a specific format.The editor instance.
The IDs of the shapes to copy.
Copy options including format.
CopyAsOptions
The format to copy as.
Scale factor for the copy. Defaults to 1.
Image quality from 0 to 1 (for PNG format).
Padding around the copied shapes in pixels.
Whether to include the background.
Example
exportToString
Export shapes to a string representation (SVG or JSON).The editor instance.
The IDs of the shapes to export.
The export format.
Additional export options.