LogoSniCap
OverviewDemosAPIArchitecture

API reference

@reactsnap/svg

SVG output helpers for foreignObject-based serialization and future mode expansion.

API Reference@reactsnap/svgMenu

SVG output helpers and current mode limitations.

On this page

@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.