CSS Clay Button
A puffy claymorphism button made from inner highlights, inner shade and a soft drop shadow.
<button class="btn-clay">Let’s play</button>
.btn-clay {
padding: 16px 34px;
border: 0;
border-radius: 20px;
background: #a78bfa;
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
text-shadow: 0 1px 1px rgba(76, 29, 149, 0.4);
box-shadow:
inset 0 -6px 10px rgba(76, 29, 149, 0.35),
inset 0 6px 10px rgba(255, 255, 255, 0.45),
0 12px 24px -8px rgba(124, 58, 237, 0.55);
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-clay:hover {
transform: translateY(-2px);
box-shadow:
inset 0 -6px 10px rgba(76, 29, 149, 0.35),
inset 0 6px 10px rgba(255, 255, 255, 0.45),
0 16px 30px -8px rgba(124, 58, 237, 0.6);
}
.btn-clay:active {
transform: translateY(1px) scale(0.98);
box-shadow:
inset 0 -3px 8px rgba(76, 29, 149, 0.35),
inset 0 4px 8px rgba(255, 255, 255, 0.4),
0 6px 12px -6px rgba(124, 58, 237, 0.5);
}
.btn-clay:focus-visible {
outline: 2px solid #7c3aed;
outline-offset: 3px;
}
About this CSS Clay Button
This CSS Clay Button is 36 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and text shadows. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#a78bfa#fff#7c3aed
How to use this clay button
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.btn-clayclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.