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
1ascrub 25%
Drawn44%
1bscrub 50%
Drawn75%
1cscrub 75%
Drawn94%
1dscrub 100%
Drawn100%
Fig. 1 — one stroke, four scrub positions, ease-out: the curve front-loads the ink
Fig. 2core options only — easing, speed000%
Asource · svg7 ln · 577 ch
Bspecimen
Progress 0%ease-out · 1.0×
COptions0 on

Examples8 presets

Preset
Easing
Speed1.00×
Stagger0.00
Direction
Fade

opacity 0→1

Once

lock at 100%

015 steps

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.

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

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

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

  4. 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.tsx6 lines
    <ScrollDraw
      easing="ease-out"
      stagger={0.12}
    >
      <svg>...</svg>
    </ScrollDraw>
  5. 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.

02Parts list

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.

03Keep going

Take it further