SVG Line Drawing
Disegno a tratto SVG · Dibujo de línea SVG · Line drawing animation · Stroke animation · Self-drawing SVG
An illustration or signature seems to draw itself stroke by stroke, as if an invisible pen were tracing it on screen. The trick is animating the SVG stroke dash until the line is complete.
- Era
- 2013 – today
- Use
- Mainstream
Live demo
View code
<main>
<svg viewBox="0 0 380 210" aria-hidden="true">
<circle class="d d1" cx="292" cy="58" r="22" pathLength="1" stroke="#E4572E"/>
<path class="d d2" pathLength="1" stroke="#1B2A41" d="M10 190 L84 98 L118 136 L186 48 L246 140 L282 108 L370 190"/>
<path class="d d3" pathLength="1" stroke="#2E86AB" d="M20 190 C 80 170 120 200 190 182 S 300 168 360 190"/>
<path class="d d4" pathLength="1" stroke="#1B2A41" d="M166 74 l20 -26 l20 30 M176 66 l10 8 l10 -6"/>
</svg>
<h1>Una linea, <em>un viaggio</em></h1>
</main> body{margin:0;height:100vh;display:grid;place-items:center;overflow:hidden;background:#F4EFE6;color:#1B2A41;font-family:'DM Sans',sans-serif}
main{width:min(420px,92vw);text-align:center}
svg{width:100%;height:auto;display:block}
.d{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1}
h1{margin:4px 0 0;font:500 15px 'DM Sans',sans-serif;letter-spacing:.14em;text-transform:uppercase}
em{font:italic 600 22px Fraunces,serif;letter-spacing:0;text-transform:none;color:#E4572E}
@media (prefers-reduced-motion:no-preference){
.d{stroke-dashoffset:1;animation:draw 6s cubic-bezier(.65,0,.35,1) infinite}
.d1{animation-delay:1.4s}.d3{animation-delay:.7s}.d4{animation-delay:1.1s}
@keyframes draw{0%{stroke-dashoffset:1}35%,80%{stroke-dashoffset:0;opacity:1}92%,100%{stroke-dashoffset:0;opacity:0}}
} Characteristics
- stroke-dasharray equal to path length
- stroke-dashoffset animated to zero
- Strokes sequenced one after another
- Even-weight lines with no fill
- Often tied to scroll or viewport entry
Palette
Click a swatch to copy it
Typography
Headings · Fraunces SVG Line Drawing
Body · DM Sans An illustration or signature seems to draw itself stroke by stroke, as if an invisible pen were tracing it on screen. The trick is animating the SVG stroke dash until the line is complete.
Motion
- Easing
ease-in-out o cubic-bezier(0.65, 0, 0.35, 1)- Typical duration
- 1–3 s per illustrazione, tratti sfalsati di 150–400 ms
- Techniques
- stroke-dasharray e stroke-dashoffset, pathLength="1" per normalizzare, getTotalLength(), GSAP DrawSVG, Vivus.js, scroll-linked con ScrollTrigger
Accessibility (reduced motion)
Show the finished drawing, at most with a simple fade.
Prompt for your agent
Copy and paste into your prompt to have an agent or image generator reproduce this style.
For web pages and UI
Design the web page or interface in this style: SVG Line Drawing (Disegno a tratto SVG, Dibujo de línea SVG). An illustration or signature seems to draw itself stroke by stroke, as if an invisible pen were tracing it on screen. The trick is animating the SVG stroke dash until the line is complete. Characteristics: stroke-dasharray equal to path length, stroke-dashoffset animated to zero, Strokes sequenced one after another, Even-weight lines with no fill, Often tied to scroll or viewport entry. Palette: #F4EFE6, #1B2A41, #E4572E, #2E86AB, #C9C1B1. Typography: headings in Fraunces, body text in DM Sans (Google Fonts or equivalents). Mood: elegant, calm, organic. Motion: easing ease-in-out o cubic-bezier(0.65, 0, 0.35, 1), typical duration 1–3 s per illustrazione, tratti sfalsati di 150–400 ms; techniques: stroke-dasharray e stroke-dashoffset, pathLength="1" per normalizzare, getTotalLength(), GSAP DrawSVG, Vivus.js, scroll-linked con ScrollTrigger. With prefers-reduced-motion: Show the finished drawing, at most with a simple fade. References: CSS-Tricks «How SVG Line Animation Works» di Chris Coyier, GSAP DrawSVGPlugin, Vivus.js, MDN «stroke-dashoffset».
Relations
Influenced
References
- CSS-Tricks «How SVG Line Animation Works» di Chris Coyier
- GSAP DrawSVGPlugin
- Vivus.js
- MDN «stroke-dashoffset»