Torn Paper Edge
A paper strip with a torn, deckled or scissor-cut edge, with a roughness slider.
AI prompt
Mixed-media collage photograph of a strip of kraft paper with a hand-torn bottom edge, the tear revealing a pale white fibrous border under the brown surface, resting on a cream sheet with a soft shadow, a handwritten word in black marker on the strip, subtle paper texture, overhead light, shallow depth of field. Variants: gently deckled edge, zigzag pinking-shear edge. Negative: straight cut line, digital jagged edge, perfectly even teeth, text errors, hands. Reduced motion: static image.About this pattern
Definition
A torn edge is irregular on two scales: large wobbles and tiny fibres. A clip-path polygon with many random points along one edge gives the large wobble; a pale fringe under it suggests the exposed fibres. A scissor cut is a straight or zigzag line instead.
When to use it
- Generate points with a fixed seed so the edge stays stable.
- Put a lighter strip of paper under the torn edge; real torn paper shows a white fibrous border.
- Add a soft shadow with drop-shadow so the strip lifts off the page.
What the controls do
- Three edges (Torn, Deckle, Zigzag) and a Roughness slider.
Motion & timing
- The edge redraws as you drag the slider.
- Reduced motion: nothing animates.
Tips & variations
- More than about 60 points per edge is wasted; the eye cannot tell.
- Keep roughness modest on small elements.
Code of this live preview
<div class="bx"><div class="sc"><div class="sh" id="sh"><div class="pa" id="pa"></div><div class="tp" id="tp"><b>Torn note</b></div></div></div><div class="pre" id="pre" role="group" aria-label="Edge"><button data-p="0" aria-pressed="true">Torn</button><button data-p="1" aria-pressed="false">Deckle</button><button data-p="2" aria-pressed="false">Zigzag</button></div><label class="rw">Roughness <b id="rv">50%</b><input id="rg" type="range" min="0" max="100" value="50"></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}
.sc{height:140px;border-radius:12px;background:#f1ede4;display:grid;place-items:center;overflow:hidden}
.sh{position:relative;width:230px;height:100px;filter:drop-shadow(0 6px 5px rgba(0,0,0,.25))}.pa,.tp{position:absolute;inset:0}
.pa{background:#fbfaf5}.tp{background:#c49a6c;display:grid;place-items:center;color:#2a1b0e;font-size:20px;letter-spacing:-.01em;background-image:repeating-linear-gradient(0deg,rgba(0,0,0,.04) 0 1px,transparent 1px 3px)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const pa=document.getElementById('pa'),tp=document.getElementById('tp'),rg=document.getElementById('rg'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function edge(inset,rough,type){let sd=9;const rnd=()=>(sd=(sd*16807)%2147483647)/2147483647,pts=[];const n=type===2?24:56;for(let i=0;i<=n;i++){const x=100-i*100/n;let y;if(type===2)y=100-inset-(i%2?rough*.2:0);else if(type===1)y=100-inset-rnd()*rough*.12;else y=100-inset-(Math.sin(i*.45)*rough*.1+rnd()*rough*.12);pts.push(x.toFixed(2)+'% '+y.toFixed(2)+'%');}return 'polygon(0 0,100% 0,100% 100%,'+pts.join(',')+',0 100%)';}
function up(){const r=+rg.value;tp.style.clipPath=edge(r*.14,r,p);pa.style.clipPath=edge(Math.max(0,r*.14-3),r,p);document.getElementById('rv').textContent=r+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));rg.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>Torn Paper Edge — 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}
.sc{height:140px;border-radius:12px;background:#f1ede4;display:grid;place-items:center;overflow:hidden}
.sh{position:relative;width:230px;height:100px;filter:drop-shadow(0 6px 5px rgba(0,0,0,.25))}.pa,.tp{position:absolute;inset:0}
.pa{background:#fbfaf5}.tp{background:#c49a6c;display:grid;place-items:center;color:#2a1b0e;font-size:20px;letter-spacing:-.01em;background-image:repeating-linear-gradient(0deg,rgba(0,0,0,.04) 0 1px,transparent 1px 3px)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="sc"><div class="sh" id="sh"><div class="pa" id="pa"></div><div class="tp" id="tp"><b>Torn note</b></div></div></div><div class="pre" id="pre" role="group" aria-label="Edge"><button data-p="0" aria-pressed="true">Torn</button><button data-p="1" aria-pressed="false">Deckle</button><button data-p="2" aria-pressed="false">Zigzag</button></div><label class="rw">Roughness <b id="rv">50%</b><input id="rg" type="range" min="0" max="100" value="50"></label></div>
</div>
<script>
const pa=document.getElementById('pa'),tp=document.getElementById('tp'),rg=document.getElementById('rg'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function edge(inset,rough,type){let sd=9;const rnd=()=>(sd=(sd*16807)%2147483647)/2147483647,pts=[];const n=type===2?24:56;for(let i=0;i<=n;i++){const x=100-i*100/n;let y;if(type===2)y=100-inset-(i%2?rough*.2:0);else if(type===1)y=100-inset-rnd()*rough*.12;else y=100-inset-(Math.sin(i*.45)*rough*.1+rnd()*rough*.12);pts.push(x.toFixed(2)+'% '+y.toFixed(2)+'%');}return 'polygon(0 0,100% 0,100% 100%,'+pts.join(',')+',0 100%)';}
function up(){const r=+rg.value;tp.style.clipPath=edge(r*.14,r,p);pa.style.clipPath=edge(Math.max(0,r*.14-3),r,p);document.getElementById('rv').textContent=r+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));rg.addEventListener('input',up);up();
</script>
</body></html>