Hand-drawn Wobbly Lines
Clean boxes and lines turned into hand-drawn doodles with an SVG turbulence filter, with a roughness slider.
AI prompt
Hand-drawn sketch style illustration of a simple wireframe, a rounded rectangle for a browser window, two boxes, a circle with a checkmark and an arrow pointing between them, all drawn with slightly wobbly dark blue marker lines of uneven thickness, small gaps where lines meet, light yellow highlight fills offset a little from the outlines, on an off-white paper background, friendly and informal. Variants: a thin pencil line version and a thick marker version. Negative: perfectly straight vector lines, gradients, shadows, text errors, clutter. Reduced motion: static illustration.About this pattern
Definition
Perfectly straight vector lines can feel cold. A small amount of random wobble makes them look hand-drawn. An SVG displacement filter nudges every point of a shape a little using noise, so rectangles, circles and arrows keep their form but gain a human, sketchy edge.
When to use it
- feTurbulence builds a smooth noise map and feDisplacementMap shifts the shape by it.
- A low scale of about 1.5 to 4 pixels looks drawn; high values look broken.
- Use a lower baseFrequency for slow wobble and a higher one for jitter.
- Pair with a marker or pencil-like stroke width and slightly rounded line caps.
What the controls do
- Three style buttons and a Roughness slider.
Motion & timing
- Updates follow the slider.
- Reduced motion: nothing animates.
Tips & variations
- Keep text outside the filter or use it lightly so it stays readable.
- The filter is applied to vector shapes only; avoid heavy use on large photos.
Code of this live preview
<svg width="0" height="0" aria-hidden="true" focusable="false"><defs><filter id="wb" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence id="tu" type="fractalNoise" baseFrequency="0.03" numOctaves="2" seed="3" result="n"/><feDisplacementMap id="dm" in="SourceGraphic" in2="n" scale="3" xChannelSelector="R" yChannelSelector="G"/></filter></defs></svg><div class="bx"><div class="pre" id="pre" role="group" aria-label="Style"><button data-p="0" aria-pressed="true">Marker</button><button data-p="1" aria-pressed="false">Pencil</button><button data-p="2" aria-pressed="false">Clean</button></div><svg class="dw" id="dw" viewBox="0 0 300 130" role="img" aria-label="Sketch of two boxes joined by an arrow"><g id="g" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="14" y="14" width="272" height="102" rx="10"/><rect x="34" y="40" width="80" height="54" rx="6" fill="#ffe98a"/><circle cx="224" cy="67" r="30" fill="#c9f0d8"/><path d="M212 68l9 9 17-20"/><path d="M118 67h72M180 58l12 9-12 9"/></g></svg><label class="rw">Roughness <b id="rv">3</b><input id="rs" type="range" min="0" max="8" step="0.5" value="3"></label></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.dw{width:100%;height:auto;background:#fffdf6;border:1px solid var(--line);border-radius:12px}#g{filter:url(#wb)}.out{font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const S=[['#1f3a8a',3.2],['#4a4a4a',1.4],['#1f3a8a',2.4]],g=document.getElementById('g'),dm=document.getElementById('dm'),tu=document.getElementById('tu'),rs=document.getElementById('rs'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){g.setAttribute('stroke',S[p][0]);g.setAttribute('stroke-width',S[p][1]);const r=p===2?0:+rs.value;dm.setAttribute('scale',r);tu.setAttribute('baseFrequency',p===1?'0.05':'0.03');document.getElementById('rv').textContent=p===2?'0 (clean)':rs.value;rs.disabled=p===2;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));rs.addEventListener('input',up);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Hand-drawn Wobbly Lines — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.dw{width:100%;height:auto;background:#fffdf6;border:1px solid var(--line);border-radius:12px}#g{filter:url(#wb)}.out{font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<svg width="0" height="0" aria-hidden="true" focusable="false"><defs><filter id="wb" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence id="tu" type="fractalNoise" baseFrequency="0.03" numOctaves="2" seed="3" result="n"/><feDisplacementMap id="dm" in="SourceGraphic" in2="n" scale="3" xChannelSelector="R" yChannelSelector="G"/></filter></defs></svg><div class="bx"><div class="pre" id="pre" role="group" aria-label="Style"><button data-p="0" aria-pressed="true">Marker</button><button data-p="1" aria-pressed="false">Pencil</button><button data-p="2" aria-pressed="false">Clean</button></div><svg class="dw" id="dw" viewBox="0 0 300 130" role="img" aria-label="Sketch of two boxes joined by an arrow"><g id="g" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="14" y="14" width="272" height="102" rx="10"/><rect x="34" y="40" width="80" height="54" rx="6" fill="#ffe98a"/><circle cx="224" cy="67" r="30" fill="#c9f0d8"/><path d="M212 68l9 9 17-20"/><path d="M118 67h72M180 58l12 9-12 9"/></g></svg><label class="rw">Roughness <b id="rv">3</b><input id="rs" type="range" min="0" max="8" step="0.5" value="3"></label></div>
</div>
<script>
const S=[['#1f3a8a',3.2],['#4a4a4a',1.4],['#1f3a8a',2.4]],g=document.getElementById('g'),dm=document.getElementById('dm'),tu=document.getElementById('tu'),rs=document.getElementById('rs'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){g.setAttribute('stroke',S[p][0]);g.setAttribute('stroke-width',S[p][1]);const r=p===2?0:+rs.value;dm.setAttribute('scale',r);tu.setAttribute('baseFrequency',p===1?'0.05':'0.03');document.getElementById('rv').textContent=p===2?'0 (clean)':rs.value;rs.disabled=p===2;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));rs.addEventListener('input',up);up();
</script>
</body></html>