Clay Puffy Buttons
Inflated, clay-like buttons and a toggle in four colours, with a puffiness slider and a satisfying press.
AI prompt
Soft 3D UI render in a claymorphism style: three inflated pastel peach buttons, one wide and two round with simple icons, plus a pill toggle switched on, all with very large radii, glossy top-left inner highlight, darker inner shadow at the bottom right and a soft peach-toned drop shadow, on a warm cream background, studio softbox light, tactile and playful. Variants: mint, lilac and sky blue. Negative: hard edges, harsh black shadows, text errors, grey tones, clutter. Reduced motion: static render.About this pattern
Definition
Claymorphism makes interface elements look like soft clay or inflated plastic. It uses large radii, a soft outer shadow, a light inner highlight at the top left and a darker inner shadow at the bottom right, so the shape looks round and squeezable.
Purpose & UX principles
- Radius of at least 20px, often fully round.
- Outer shadow in a darker tone of the same colour, not grey.
- Two inner shadows: light on the top left, dark on the bottom right.
- On press, move down a pixel or two and soften the shadows so it feels squashed.
Interaction states
- Four colour buttons and a Puffiness slider; press the buttons and the toggle.
Motion specification
- Press compresses in 120ms.
- Reduced motion: no movement, shadows still change.
Responsive behaviour
- Keep label contrast high; pastel clay colours need dark text.
- Use it for playful products and keep it to a few key controls.
Code
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Colour"><button data-p="0" aria-pressed="true">Peach</button><button data-p="1" aria-pressed="false">Mint</button><button data-p="2" aria-pressed="false">Lilac</button><button data-p="3" aria-pressed="false">Sky</button></div><div class="st" id="st"><button class="cb wide" type="button">Get started</button><button class="cb round" type="button" aria-label="Like">♥</button><button class="cb tg" id="tg" type="button" role="switch" aria-checked="true" aria-label="Toggle"><i></i></button></div><label class="rw">Puffiness <b id="pv">60%</b><input id="pf" type="range" min="10" max="100" value="60"></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}
.st{display:flex;gap:14px;align-items:center;justify-content:center;padding:18px 10px;border-radius:14px;background:var(--bg0)}.cb{--sd:rgba(0,0,0,calc(var(--p)*.22));border-radius:22px;background:var(--c);color:#3b2a20;font-weight:700;font-size:13px;box-shadow:calc(var(--p)*10px) calc(var(--p)*10px) calc(var(--p)*22px) var(--sh),inset calc(var(--p)*-8px) calc(var(--p)*-8px) calc(var(--p)*14px) var(--sd),inset calc(var(--p)*8px) calc(var(--p)*8px) calc(var(--p)*14px) rgba(255,255,255,.75);transition:transform .12s,box-shadow .12s}
.cb.wide{height:48px;padding:0 24px}.cb.round{width:48px;height:48px;border-radius:50%;font-size:18px}.cb.tg{width:70px;height:40px;border-radius:99px;padding:5px;display:flex;align-items:center}.cb.tg i{width:30px;height:30px;border-radius:50%;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.2);transition:transform .15s}.cb.tg[aria-checked=true] i{transform:translateX(30px)}.cb:active{transform:translateY(2px) scale(.97);box-shadow:calc(var(--p)*3px) calc(var(--p)*3px) calc(var(--p)*8px) var(--sh),inset calc(var(--p)*-4px) calc(var(--p)*-4px) calc(var(--p)*8px) var(--sd),inset calc(var(--p)*4px) calc(var(--p)*4px) calc(var(--p)*8px) rgba(255,255,255,.6)}
@media (prefers-reduced-motion:reduce){.cb:active{transform:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const K=[['#ffc9a8','rgba(214,120,70,.45)','#fff1e6'],['#bdeccb','rgba(60,160,110,.4)','#eefbf2'],['#d9c9fb','rgba(130,90,210,.4)','#f5f0ff'],['#b9dcfb','rgba(60,120,200,.4)','#edf6ff']],st=document.getElementById('st'),pf=document.getElementById('pf'),tg=document.getElementById('tg'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){st.style.setProperty('--c',K[p][0]);st.style.setProperty('--sh',K[p][1]);st.style.setProperty('--bg0',K[p][2]);st.style.setProperty('--p',pf.value/100);document.getElementById('pv').textContent=pf.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));pf.addEventListener('input',up);tg.addEventListener('click',()=>tg.setAttribute('aria-checked',String(tg.getAttribute('aria-checked')!=='true')));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>Clay Puffy Buttons — 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}
.st{display:flex;gap:14px;align-items:center;justify-content:center;padding:18px 10px;border-radius:14px;background:var(--bg0)}.cb{--sd:rgba(0,0,0,calc(var(--p)*.22));border-radius:22px;background:var(--c);color:#3b2a20;font-weight:700;font-size:13px;box-shadow:calc(var(--p)*10px) calc(var(--p)*10px) calc(var(--p)*22px) var(--sh),inset calc(var(--p)*-8px) calc(var(--p)*-8px) calc(var(--p)*14px) var(--sd),inset calc(var(--p)*8px) calc(var(--p)*8px) calc(var(--p)*14px) rgba(255,255,255,.75);transition:transform .12s,box-shadow .12s}
.cb.wide{height:48px;padding:0 24px}.cb.round{width:48px;height:48px;border-radius:50%;font-size:18px}.cb.tg{width:70px;height:40px;border-radius:99px;padding:5px;display:flex;align-items:center}.cb.tg i{width:30px;height:30px;border-radius:50%;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.2);transition:transform .15s}.cb.tg[aria-checked=true] i{transform:translateX(30px)}.cb:active{transform:translateY(2px) scale(.97);box-shadow:calc(var(--p)*3px) calc(var(--p)*3px) calc(var(--p)*8px) var(--sh),inset calc(var(--p)*-4px) calc(var(--p)*-4px) calc(var(--p)*8px) var(--sd),inset calc(var(--p)*4px) calc(var(--p)*4px) calc(var(--p)*8px) rgba(255,255,255,.6)}
@media (prefers-reduced-motion:reduce){.cb:active{transform:none}}
@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="Colour"><button data-p="0" aria-pressed="true">Peach</button><button data-p="1" aria-pressed="false">Mint</button><button data-p="2" aria-pressed="false">Lilac</button><button data-p="3" aria-pressed="false">Sky</button></div><div class="st" id="st"><button class="cb wide" type="button">Get started</button><button class="cb round" type="button" aria-label="Like">♥</button><button class="cb tg" id="tg" type="button" role="switch" aria-checked="true" aria-label="Toggle"><i></i></button></div><label class="rw">Puffiness <b id="pv">60%</b><input id="pf" type="range" min="10" max="100" value="60"></label></div>
</div>
<script>
const K=[['#ffc9a8','rgba(214,120,70,.45)','#fff1e6'],['#bdeccb','rgba(60,160,110,.4)','#eefbf2'],['#d9c9fb','rgba(130,90,210,.4)','#f5f0ff'],['#b9dcfb','rgba(60,120,200,.4)','#edf6ff']],st=document.getElementById('st'),pf=document.getElementById('pf'),tg=document.getElementById('tg'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){st.style.setProperty('--c',K[p][0]);st.style.setProperty('--sh',K[p][1]);st.style.setProperty('--bg0',K[p][2]);st.style.setProperty('--p',pf.value/100);document.getElementById('pv').textContent=pf.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));pf.addEventListener('input',up);tg.addEventListener('click',()=>tg.setAttribute('aria-checked',String(tg.getAttribute('aria-checked')!=='true')));up();
</script>
</body></html>