Embroidery Stitch Text
Lettering sewn onto fabric with a dashed thread outline, thread colours, a stitch-length slider and a sew-in animation.
AI prompt
Macro photograph of the word Hello embroidered in thick coral-red cotton thread on cream linen fabric, a neat running stitch outline with evenly spaced stitches around bold rounded letters, the inside filled with fine diagonal satin stitches, visible thread twist and tiny shadows under each stitch, warm soft light, shallow depth of field. Variants: navy thread on mustard cloth, white thread on denim. Negative: printed text, vector sharp outlines, blur on the stitches, extra letters. Reduced motion: still image.About this pattern
Definition
Embroidery text imitates thread on cloth. A dashed stroke around the letters looks like a running stitch, a light fill with diagonal lines looks like satin thread, and a woven fabric background finishes the illusion. It adds a handmade feel to badges, labels and greetings.
When to use it
- Use a bold, rounded typeface so stitches follow clear shapes.
- stroke-dasharray sets stitch and gap length; a gap about half the stitch looks natural.
- Add a faint shadow under the stitches and a slightly lighter edge to suggest thread thickness.
- A repeating-gradient cross-hatch on the cloth gives the weave.
What the controls do
- Thread colour buttons, a Stitch length slider and a Sew button.
Motion & timing
- Sewing reveals the stitching left to right over 2 seconds.
- Reduced motion: stitches appear at once.
Tips & variations
- Keep the text as real text in an SVG with a label so it stays readable to assistive tools.
- Long words need smaller stitches or they look noisy.
Code of this live preview
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Thread"><button data-p="0" aria-pressed="true">Coral</button><button data-p="1" aria-pressed="false">Navy</button><button data-p="2" aria-pressed="false">White</button></div><div class="cl" id="cl"><svg viewBox="0 0 300 110" role="img" aria-label="The word Hello embroidered with a dashed thread"><defs><pattern id="sat" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><rect width="5" height="5" fill="var(--bgc)"/><rect width="2.2" height="5" fill="var(--th)"/></pattern><clipPath id="rv"><rect id="rr" x="0" y="0" width="300" height="110"/></clipPath></defs><g clip-path="url(#rv)"><text id="tx" x="150" y="76" text-anchor="middle" font-family="system-ui,Arial Rounded MT Bold,sans-serif" font-weight="900" font-size="72" fill="url(#sat)" stroke="var(--th)" stroke-width="2.4" stroke-linecap="round" stroke-dasharray="6 3" paint-order="stroke">Hello</text></g></svg></div><div class="two"><label class="rw">Stitch length <b id="sv">6</b><input id="sl" type="range" min="2" max="12" value="6"></label><button class="mini" id="sw" type="button">Sew again</button></div></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}
.cl{height:124px;border-radius:12px;display:grid;place-items:center;background:repeating-linear-gradient(0deg,rgba(0,0,0,.05) 0 1px,transparent 1px 3px),repeating-linear-gradient(90deg,rgba(0,0,0,.05) 0 1px,transparent 1px 3px),var(--bgc)}.cl svg{width:100%;height:100%}#tx{filter:drop-shadow(0 1px 0 rgba(0,0,0,.25))}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mini{height:30px;padding:0 14px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:12px;font-weight:600;cursor:pointer}.mini:disabled{opacity:.4;cursor:default}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const T=[['#d9473d','#f1e6d0'],['#233a73','#e8b94a'],['#ffffff','#46678f']],cl=document.getElementById('cl'),tx=document.getElementById('tx'),sl=document.getElementById('sl'),rr=document.getElementById('rr'),bs=[...document.querySelectorAll('#pre button')],calm=matchMedia('(prefers-reduced-motion:reduce)').matches;let p=0,raf=0;
function up(){cl.style.setProperty('--th',T[p][0]);cl.style.setProperty('--bgc',T[p][1]);cl.parentNode.style.setProperty('--th',T[p][0]);cl.parentNode.style.setProperty('--bgc',T[p][1]);const s=+sl.value;tx.setAttribute('stroke-dasharray',s+' '+Math.max(1.5,s/2));document.getElementById('sv').textContent=s;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
function sew(){cancelAnimationFrame(raf);if(calm){rr.setAttribute('width',300);return;}const t0=performance.now();(function f(n){const k=Math.max(0,Math.min(1,(n-t0)/2000));rr.setAttribute('width',300*k);if(k<1)raf=requestAnimationFrame(f);})(t0);}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));sl.addEventListener('input',up);document.getElementById('sw').addEventListener('click',sew);up();sew();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>Embroidery Stitch Text — 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}
.cl{height:124px;border-radius:12px;display:grid;place-items:center;background:repeating-linear-gradient(0deg,rgba(0,0,0,.05) 0 1px,transparent 1px 3px),repeating-linear-gradient(90deg,rgba(0,0,0,.05) 0 1px,transparent 1px 3px),var(--bgc)}.cl svg{width:100%;height:100%}#tx{filter:drop-shadow(0 1px 0 rgba(0,0,0,.25))}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mini{height:30px;padding:0 14px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:12px;font-weight:600;cursor:pointer}.mini:disabled{opacity:.4;cursor:default}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Thread"><button data-p="0" aria-pressed="true">Coral</button><button data-p="1" aria-pressed="false">Navy</button><button data-p="2" aria-pressed="false">White</button></div><div class="cl" id="cl"><svg viewBox="0 0 300 110" role="img" aria-label="The word Hello embroidered with a dashed thread"><defs><pattern id="sat" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><rect width="5" height="5" fill="var(--bgc)"/><rect width="2.2" height="5" fill="var(--th)"/></pattern><clipPath id="rv"><rect id="rr" x="0" y="0" width="300" height="110"/></clipPath></defs><g clip-path="url(#rv)"><text id="tx" x="150" y="76" text-anchor="middle" font-family="system-ui,Arial Rounded MT Bold,sans-serif" font-weight="900" font-size="72" fill="url(#sat)" stroke="var(--th)" stroke-width="2.4" stroke-linecap="round" stroke-dasharray="6 3" paint-order="stroke">Hello</text></g></svg></div><div class="two"><label class="rw">Stitch length <b id="sv">6</b><input id="sl" type="range" min="2" max="12" value="6"></label><button class="mini" id="sw" type="button">Sew again</button></div></div>
</div>
<script>
const T=[['#d9473d','#f1e6d0'],['#233a73','#e8b94a'],['#ffffff','#46678f']],cl=document.getElementById('cl'),tx=document.getElementById('tx'),sl=document.getElementById('sl'),rr=document.getElementById('rr'),bs=[...document.querySelectorAll('#pre button')],calm=matchMedia('(prefers-reduced-motion:reduce)').matches;let p=0,raf=0;
function up(){cl.style.setProperty('--th',T[p][0]);cl.style.setProperty('--bgc',T[p][1]);cl.parentNode.style.setProperty('--th',T[p][0]);cl.parentNode.style.setProperty('--bgc',T[p][1]);const s=+sl.value;tx.setAttribute('stroke-dasharray',s+' '+Math.max(1.5,s/2));document.getElementById('sv').textContent=s;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
function sew(){cancelAnimationFrame(raf);if(calm){rr.setAttribute('width',300);return;}const t0=performance.now();(function f(n){const k=Math.max(0,Math.min(1,(n-t0)/2000));rr.setAttribute('width',300*k);if(k<1)raf=requestAnimationFrame(f);})(t0);}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));sl.addEventListener('input',up);document.getElementById('sw').addEventListener('click',sew);up();sew();
</script>
</body></html>