@reactsnap/svg is the package for SVG-oriented workflows. Today it mostly clarifies how ReactSnap exposes foreignObject-backed SVG output while leaving room for future raster-oriented SVG modes.
renderToSvg(input, options?)#
import { renderToSvg } from '@reactsnap/svg';
const svg = await renderToSvg(document.getElementById('profile-card')!, {
width: 800,
height: 418,
});
Current mode behavior#
The public package defines:
svgMode?: 'raster' | 'foreignObject'
Right now foreignObject is the implemented path. The raster mode is scaffolded and throws an explicit error instead of pretending support exists.
Where it fits#
Use the SVG package when you need string output, further SVG post-processing, or browser-side vector serialization rather than direct raster blobs.