Fabric Weave Texture
Four woven fabrics built from two crossing thread patterns, with a slider for thread size.
AI prompt
Close-up macro photograph of woven natural linen fabric filling the frame, visible warp and weft threads with slight irregular slubs, soft side light that reveals the weave, warm oatmeal colour, a single neat row of stitching along one edge, shallow depth of field, tactile and quiet. Variants: indigo denim with diagonal twill, heavy cream canvas with a tight square weave, chunky red ribbed knit. Negative: printed pattern, smooth plastic look, text, folds hiding the weave, harsh flash. Reduced motion: static image.About this pattern
Definition
A woven fabric is two sets of thread crossing at right angles (warp and weft). Two fine repeating gradients at different angles imitate that crossing, and the thread size decides whether it reads as silk, linen or burlap.
When to use it
- Linen is pale with uneven vertical and horizontal threads; denim runs the threads on a diagonal twill; canvas is a tight square weave; knit is columns of loops.
- Scale matters: the same texture at half size reads as a different, finer cloth.
- Name the weave and the colour in prompts instead of just saying fabric.
What the controls do
- Four fabric buttons and a Thread size slider.
Motion & timing
- Changing fabric or size updates instantly; there is no animation to disable.
- Reduced motion: nothing to change.
Tips & variations
- Thread size is relative to the preview, so check it at the size it will be shown.
- Very fine weaves can shimmer on low-density screens; keep threads at 2px or more.
Code of this live preview
<div class="bx"><div class="pl" id="pl"></div><div class="pre" id="pre" role="group" aria-label="Fabric"><button data-p="0" aria-pressed="true">Linen</button><button data-p="1" aria-pressed="false">Denim</button><button data-p="2" aria-pressed="false">Canvas</button><button data-p="3" aria-pressed="false">Knit</button></div><label class="rw">Thread size <b id="tv">4px</b><input id="th" type="range" min="2" max="10" value="4"></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}
.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}
.pl{height:132px;border-radius:14px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12),inset 0 0 24px rgba(0,0,0,.12);background-color:var(--b);background-image:repeating-linear-gradient(var(--g1),var(--d1) 0 calc(var(--t)*.35),transparent calc(var(--t)*.35) var(--t)),repeating-linear-gradient(var(--g2),var(--d2) 0 calc(var(--t)*.35),transparent calc(var(--t)*.35) calc(var(--t)*1.3))}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const F=[['#e6dccb','0deg','rgba(0,0,0,.07)','90deg','rgba(255,255,255,.4)'],['#2f4a73','135deg','rgba(255,255,255,.14)','45deg','rgba(0,0,0,.16)'],['#d6cab2','0deg','rgba(0,0,0,.1)','90deg','rgba(0,0,0,.1)'],['#b4463a','90deg','rgba(0,0,0,.2)','0deg','rgba(255,255,255,.14)']],pl=document.getElementById('pl'),th=document.getElementById('th'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){['--b','--g1','--d1','--g2','--d2'].forEach((k,i)=>pl.style.setProperty(k,F[p][i]));pl.style.setProperty('--t',th.value+'px');document.getElementById('tv').textContent=th.value+'px';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));th.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>Fabric Weave Texture — 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}}
.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}
.pl{height:132px;border-radius:14px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12),inset 0 0 24px rgba(0,0,0,.12);background-color:var(--b);background-image:repeating-linear-gradient(var(--g1),var(--d1) 0 calc(var(--t)*.35),transparent calc(var(--t)*.35) var(--t)),repeating-linear-gradient(var(--g2),var(--d2) 0 calc(var(--t)*.35),transparent calc(var(--t)*.35) calc(var(--t)*1.3))}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pl" id="pl"></div><div class="pre" id="pre" role="group" aria-label="Fabric"><button data-p="0" aria-pressed="true">Linen</button><button data-p="1" aria-pressed="false">Denim</button><button data-p="2" aria-pressed="false">Canvas</button><button data-p="3" aria-pressed="false">Knit</button></div><label class="rw">Thread size <b id="tv">4px</b><input id="th" type="range" min="2" max="10" value="4"></label></div>
</div>
<script>
const F=[['#e6dccb','0deg','rgba(0,0,0,.07)','90deg','rgba(255,255,255,.4)'],['#2f4a73','135deg','rgba(255,255,255,.14)','45deg','rgba(0,0,0,.16)'],['#d6cab2','0deg','rgba(0,0,0,.1)','90deg','rgba(0,0,0,.1)'],['#b4463a','90deg','rgba(0,0,0,.2)','0deg','rgba(255,255,255,.14)']],pl=document.getElementById('pl'),th=document.getElementById('th'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){['--b','--g1','--d1','--g2','--d2'].forEach((k,i)=>pl.style.setProperty(k,F[p][i]));pl.style.setProperty('--t',th.value+'px');document.getElementById('tv').textContent=th.value+'px';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));th.addEventListener('input',up);up();
</script>
</body></html>