Functions & Hooks

renderToSvg

function renderToSvg(scene: ReactNode | SceneSource, options: RenderToSvgOptions): Promise<string>;

Render a scene to SVG markup, returned as a string.

The vector counterpart to snapshot(): geometry and text stay resolution independent, so the result opens in a design tool rather than being pixels. Like the other offscreen entry points, it is a still - animated props resolve to their committed value.

Takes JSX, a SceneNode[] from the element factories, or a Scene - the non-JSX forms never touch React.

Parameters

scene

ReactNode | SceneSource

options

RenderToSvgOptions

Returns

Promise<string>

On this page