Back to Tldraw

Custom shape SVG export

apps/examples/src/examples/shapes/tools/toSvg-method-example/README.md

5.2.4350 B
Original Source

Determine how your custom shapes look when copied/exported as an image.


The "export as SVG/PNG" and "copy as SVG/PNG" actions use the toSvg or toBackgroundSvg methods of a shape util. If a shape does not have a toSvg or toBackgroundSvg method defined, it will default to placing the shape's component inside a <foreignObject> element.