API reference
The table below is generated from the public declaration files emitted for package 0.1.0. CI compares the reflection snapshot with every build.
Public exports
| Export | Kind | Entry |
|---|---|---|
SvgAnimationError | Class | root |
SvgPreparationError | Class | root |
MountSvgMotionOptions | Interface | root |
PreparedSvg | Interface | root |
PrepareSvgOptions | Interface | root |
SvgDiagnostic | Interface | root |
SvgMotionController | Interface | root |
SvgMotionInstance | Interface | root |
SvgMotionOptions | Interface | root |
SvgAnimationErrorCode | Type alias | root |
SvgDiagnosticCode | Type alias | root |
SvgMotionControllerState | Type alias | root |
SvgMotionOrder | Type alias | root |
SvgMotionPreset | Type alias | root |
SvgPreparationErrorCode | Type alias | root |
SvgSource | Type alias | root |
SvgTrustMode | Type alias | root |
SVG_ANIMATION_ERROR_CODES | Variable | root |
SVG_PREPARATION_ERROR_CODES | Variable | root |
animateSvg | Function | root |
mountSvgMotion | Function | root |
prepareSvg | Function | root |
SvgMotionHandle | Interface | /react |
SvgMotionProps | Interface | /react |
SvgMotionReadyHandle | Interface | /react |
SvgMotionSvgProps | Interface | /react |
UseSvgMotionOptions | Interface | /react |
UseSvgMotionResult | Interface | /react |
SvgMotionRole | Type alias | /react |
SvgMotionStatus | Type alias | /react |
SvgMotion | Variable | /react |
useSvgMotion | Function | /react |
Errors
Preparation failures use SvgPreparationError; animation failures use SvgAnimationError. Inspect the stable code, not the human-readable message. Categories cover unsupported environments or sources, byte limits, fetch and abort failures, invalid or unsafe SVG, setup failures and runtime animation failures.
Diagnostics report non-fatal fallbacks such as an SVG without drawable geometry. Entries expose only a code and safe counts.
Browser support
Version 0.1 targets evergreen Chromium, Firefox and WebKit with native Web Animations API and SVGGeometryElement.getTotalLength() support. The package is ESM-only and requires Node 22+ for its development toolchain.