Skip to Content
DocsGuidesInstallation

Installation

Install sprungdesign with your package manager of choice:

npm install sprungdesign

React (optional)

React is an optional peer dependency. You only need it if you import the hook from sprungdesign/react:

import { useSpring } from "sprungdesign/react";

The core entry point (sprungdesign) has no peer dependencies and works anywhere — vanilla DOM, Vue, Svelte, canvas, WebGL, Node, you name it.

TypeScript

sprungdesign ships with its own type definitions — no @types/* package needed. The React subpath has its own types too:

import { spring, createSpring, fromFeel, presets } from "sprungdesign"; import { useSpring } from "sprungdesign/react";

Bundlers

sprungdesign is published as an ESM + CJS dual package with sideEffects: false, so it tree-shakes cleanly and works in modern bundlers (Vite, webpack, esbuild, Rollup, Turbopack) and in Node.js without extra configuration.

The core is ~1 kB min+gzip; the React adapter is a thin layer on top.

Server-side rendering

The core is SSR-safe: importing or constructing a spring never touches the DOM. The clock and scheduler (now / raf / caf) are resolved lazily, only when animation actually starts.

useSpring returns its target value on the server (and on the first client render), so there’s no hydration mismatch — animation begins after mount, on the next target change.

Next steps

Last updated on