Gel Translucent Buttons
Glossy, jelly-like buttons built from gradients, an inner highlight and soft shadows, with colour and gloss controls.
AI prompt
Close-up product render of a glossy jelly-style button, rounded pill shape in translucent lime green with a bright white curved highlight across the top half, soft inner shadow at the bottom, a coloured glow underneath it, the label Start in dark green bold text, set on a pale neutral background; variants in grape purple and cherry red. Negative: flat colour, harsh black outline, noise, clutter, text errors. Reduced motion: still image.About this pattern
Definition
A gel button looks like a drop of coloured jelly: translucent colour, a bright curved highlight on the top half and a soft glow underneath. It feels tactile and playful. The effect is layered gradients and shadows, with a pressed state that flattens the highlight and darkens the colour.
Purpose & UX principles
- Base: a vertical gradient from a lighter to a deeper tone of one hue.
- Highlight: a white-to-transparent gradient over the top half with rounded corners.
- Depth: an inset shadow at the bottom and a coloured outer glow.
- Pressed: shift down one pixel, reduce the glow, dim the highlight.
Interaction states
- Colour buttons, a Gloss slider and a live button to press.
Motion specification
- Press changes in 80ms.
- Reduced motion: no transition.
Responsive behaviour
- Keep label contrast high against the coloured fill; use dark or white text as needed.
- Do not overuse; reserve gel buttons for a single primary action.
Code
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Colour"><button data-p="0" aria-pressed="true">Lime</button><button data-p="1" aria-pressed="false">Grape</button><button data-p="2" aria-pressed="false">Cherry</button></div><div class="st"><button class="gel" id="gl" type="button">Start</button><button class="gel sm" type="button" tabindex="-1" aria-hidden="true">Skip</button></div><label class="rw">Gloss <b id="gv">70%</b><input id="gs" type="range" min="0" max="100" value="70"></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;justify-content:center;align-items:center;padding:24px 0;border-radius:12px;background:var(--surface);border:1px solid var(--line)}.gel{position:relative;min-width:130px;height:46px;padding:0 24px;border-radius:99px;font:700 15px system-ui,sans-serif;color:var(--fg);background:linear-gradient(var(--c1),var(--c2));box-shadow:inset 0 -6px 10px var(--c3),0 6px 14px var(--gw),0 1px 0 rgba(255,255,255,.5);overflow:hidden;transition:transform .08s,box-shadow .08s}.gel::before{content:"";position:absolute;left:6px;right:6px;top:3px;height:48%;border-radius:99px;background:linear-gradient(rgba(255,255,255,var(--gl)),rgba(255,255,255,calc(var(--gl)*.15)))}.gel.sm{min-width:80px;filter:saturate(.35)}.gel:active{transform:translateY(1px);box-shadow:inset 0 -3px 8px var(--c3),0 2px 6px var(--gw)}.gel:active::before{opacity:.6}@media (prefers-reduced-motion:reduce){.gel{transition:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const P=[['#c9f26a','#6fbf1f','rgba(40,110,10,.55)','rgba(90,170,20,.45)','#1d3d08'],['#c9a2ff','#7a3be0','rgba(60,10,130,.55)','rgba(120,60,220,.45)','#fff'],['#ff9a9a','#d62d3f','rgba(120,10,25,.55)','rgba(220,50,70,.45)','#fff']],st=document.querySelector('.st'),gs=document.getElementById('gs'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){const c=P[p];['--c1','--c2','--c3','--gw','--fg'].forEach((k,i)=>st.style.setProperty(k,c[i]));st.style.setProperty('--gl',gs.value/100);document.getElementById('gv').textContent=gs.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));gs.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>Gel Translucent 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;justify-content:center;align-items:center;padding:24px 0;border-radius:12px;background:var(--surface);border:1px solid var(--line)}.gel{position:relative;min-width:130px;height:46px;padding:0 24px;border-radius:99px;font:700 15px system-ui,sans-serif;color:var(--fg);background:linear-gradient(var(--c1),var(--c2));box-shadow:inset 0 -6px 10px var(--c3),0 6px 14px var(--gw),0 1px 0 rgba(255,255,255,.5);overflow:hidden;transition:transform .08s,box-shadow .08s}.gel::before{content:"";position:absolute;left:6px;right:6px;top:3px;height:48%;border-radius:99px;background:linear-gradient(rgba(255,255,255,var(--gl)),rgba(255,255,255,calc(var(--gl)*.15)))}.gel.sm{min-width:80px;filter:saturate(.35)}.gel:active{transform:translateY(1px);box-shadow:inset 0 -3px 8px var(--c3),0 2px 6px var(--gw)}.gel:active::before{opacity:.6}@media (prefers-reduced-motion:reduce){.gel{transition: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">Lime</button><button data-p="1" aria-pressed="false">Grape</button><button data-p="2" aria-pressed="false">Cherry</button></div><div class="st"><button class="gel" id="gl" type="button">Start</button><button class="gel sm" type="button" tabindex="-1" aria-hidden="true">Skip</button></div><label class="rw">Gloss <b id="gv">70%</b><input id="gs" type="range" min="0" max="100" value="70"></label></div>
</div>
<script>
const P=[['#c9f26a','#6fbf1f','rgba(40,110,10,.55)','rgba(90,170,20,.45)','#1d3d08'],['#c9a2ff','#7a3be0','rgba(60,10,130,.55)','rgba(120,60,220,.45)','#fff'],['#ff9a9a','#d62d3f','rgba(120,10,25,.55)','rgba(220,50,70,.45)','#fff']],st=document.querySelector('.st'),gs=document.getElementById('gs'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){const c=P[p];['--c1','--c2','--c3','--gw','--fg'].forEach((k,i)=>st.style.setProperty(k,c[i]));st.style.setProperty('--gl',gs.value/100);document.getElementById('gv').textContent=gs.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));gs.addEventListener('input',up);up();
</script>
</body></html>