TldrawImageProps
See source codeTable of contents
Extends TLImageExportOptions.
interface TldrawImageProps extends TLImageExportOptions {}Properties
assetUrls
Asset URL overrides.
assetUrls?: TLUiAssetUrlOverridesbackground
Should the background color be included in the export? If false, the generated image will be transparent (if exporting to a format that supports transparency).
background?: booleanbindingUtils
Additional binding utils to use.
bindingUtils?: readonly TLAnyBindingUtilConstructor[]bounds
The bounding box, in page coordinates, of the area being exported.
bounds?: BoxdarkMode
Should the export be rendered in dark mode (true) or light mode (false)? Defaults to the current instance's dark mode setting.
darkMode?: booleanformat
The image format to use. Defaults to 'svg'.
format?: 'png' | 'svg'licenseKey
The license key.
licenseKey?: stringpadding
How much padding to include around the bounds of exports? Defaults to 32px.
padding?: numberpageId
The page to display. Defaults to the first page.
pageId?: TLPageIdpixelRatio
When exporting an SVG, the expected pixel ratio of the export will be passed in to
TLAssetStore.resolve as the dpr property, so that assets can be
downscaled to the appropriate resolution.
When exporting to a bitmap image format, the size of the resulting image will be multiplied by this number.
For SVG exports, this defaults to undefined - which means we'll request original-quality assets. For bitmap exports, this defaults to 2.
pixelRatio?: numberpreserveAspectRatio
The
preserveAspectRatio
attribute of the SVG element.
preserveAspectRatio?: React.SVGAttributes<SVGSVGElement>['preserveAspectRatio']quality
If the export is being converted to a lossy bitmap format (e.g. jpeg), this is the quality of the export. This is a number between 0 and 1.
quality?: numberscale
The logical scale of the export. This scales the resulting size of the SVG being generated.
scale?: numbershapeUtils
Additional shape utils to use.
shapeUtils?: readonly TLAnyShapeUtilConstructor[]snapshot
The snapshot to display.
snapshot: Partial<TLEditorSnapshot> | TLStoreSnapshottextOptions
Text options for the editor.
textOptions?: TLTextOptions