playground / try it livev2.31.0
SVG scroll animation playground
Paste any SVG and scrub it the way scrolling will draw it. Tweak easing, speed, stagger, fade, stroke colour, morphTo and clip mode, copy the component it prints, and share the result as a URL.
- Draw presets
- 8
- v2 presets
- 10
- Easings
- 7
- Gzipped
- 11.9 KB
Examples8 presets
opacity 0→1
lock at 100%
From the bench to your page
The bench is the library with the scroll taken out: a scrubber drives the same progress a page would, so what you tune here is what ships.
Step 01 · source, A
Paste any SVG
Drop markup into panel A and it mounts a moment after you stop typing. Before it does, the playground strips <script>, <foreignObject> and every on* handler, then sizes the drawing to fit the specimen.
Step 02 · specimen, B
Scrub instead of scrolling
The track under panel B stands in for the page’s scroll position: 0% is where the trigger starts, 100% where it ends. Play loops it, reset puts it back to 0, and paper or slate swaps the ground under the drawing.
Step 03 · options, C
Tune it
Easing, speed, stagger and direction, then colour, width, fill, clip and morph. Each control writes one prop of the component — the parts list below says which.
Step 04 · code, C
Copy the component
The code tab prints a <ScrollDraw> with only the props you moved off their defaults. This is what it prints for the first preset:
Drawing.tsx<ScrollDraw easing="ease-out" stagger={0.12} > <svg>...</svg> </ScrollDraw>Step 05 · share, fig. 2
Send the bench
Share writes the whole state — your markup included — into the URL after #p= and copies the link. Whoever opens it gets the same drawing and the same options, ready to scrub.
Every control is a prop
The options panel is the component's props, laid out. Each control below maps to an option you can pass yourself, with the range the bench lets you try.
v1 · scrollDraw
01Presetpresetsketch · reveal · typewriter · cinematic · spring02Easingeasinglinear · ease-in · ease-out · ease-in-out · spring · bounce · elastic03Bounce paramscreateBounce()bounces 1–6 · decay 0.1–0.904Elastic paramscreateElastic()amplitude 1–2.5 · period 0.1–0.805Speedspeed0.1× – 3×06Staggerstagger0 – 0.507Directiondirectionforward · reverse08Onceoncelocks at 100%09Fadefadeopacity 0 → 110Stroke colourstrokeColor[from, to]11Stroke widthstrokeWidth[from, to]12Fill opacityfillOpacity[from, to]13Clip revealclipleft · right · top · bottom · center14Path morphmorphToA target d with the same numeric tokens