Ship your product,<br>not your bugs.
pas vos bugs.
Join 2,400 teams who build faster with Effect.
Pure CSS button with visual click feedback — indigo-violet gradient, 0.95× press scale on :active, hover glow, and a 🔊 icon that pulses via the .clicked class.
This effect is free — the Atmosphere category contains 57 effects total, including 10 free. Effect.Labs has 811 vanilla effects. Explore the category →
Join 2,400 teams who build faster with Effect.
Pro
100+ curated CSS effects every Friday, free.
No spam. Unsubscribe anytime.
The effect relies entirely on CSS transitions without a single line of JavaScript in the provided code. Two properties drive the visual mechanics: transform: scale(0.95) on :active simulates a physical button press in 0.15 s, and box-shadow adds a semi-transparent indigo halo (rgba, 40% opacity, 20 px blur) on hover, carried by the same 0.15 s transition.
The .snd-wave icon (🔊) has its own 0.2 s transition. It grows to scale(1.3) when the .clicked class is added to the button — a mechanism designed to be triggered by a small JS listener in your project (btn.classList.add('clicked') then removed after 250 ms). The provided code does not include this listener: two lines to write in your framework.
The background is a linear-gradient(135°) from rgb(99,102,241) (indigo-500) to rgb(168,85,247) (violet-500) applied directly to the <button>. The button uses display:flex with gap:8px to align icon and text without manual margin math. border-style:none removes the native button border.
transform, box-shadow) apply even when the user has requested reduced motion. Fix: add @media (prefers-reduced-motion: reduce) { .snd-click-btn, .snd-click-btn .snd-wave { transition: none; } }.<button> — keyboard-focusable by default, activatable via Enter and Space. No manual tabindex needed.:focus-visible style is defined in the provided CSS: the browser's native outline applies. For WCAG 2.4.11 (Focus Appearance), add .snd-click-btn:focus-visible { outline: 2px solid #818cf8; outline-offset: 3px; }.Requires CSS Transitions and CSS Gradients — supported in all modern browsers since 2013. Zero external dependencies.
Without CSS Transitions support, the button displays correctly (gradient, color, padding) but without animation — 100% functional, just static.
Copy the three blocks into your page. No dependencies.
<button class="snd-click-btn" id="sndClickBtn">
<span class="snd-wave">🔊</span> Click Me
</button>
.snd-click-btn {
padding: 14px 28px;
border-width: medium;
border-style: none;
border-color: currentcolor;
border-image: initial;
border-radius: 10px;
background: linear-gradient(135deg, rgb(99, 102, 241), rgb(168, 85, 247));
color: rgb(255, 255, 255);
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: transform 0.15s, box-shadow 0.15s;
display: flex;
align-items: center;
gap: 8px;
}
.snd-click-btn:active {
transform: scale(0.95);
}
.snd-click-btn:hover {
box-shadow: rgba(99, 102, 241, 0.4) 0px 4px 20px;
}
.snd-click-btn .snd-wave {
display: inline-block;
transition: transform 0.2s;
}
.snd-click-btn.clicked .snd-wave {
transform: scale(1.3);
}
// Effet CSS pur — pas de JavaScript nécessaire
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
| background (CSS) | linear-gradient(135deg, rgb(99,102,241), rgb(168,85,247)) | Gradient colors — swap the two rgb() values for your brand colors. Also accepts hex or a flat color. |
| border-radius (CSS) | 10px | Corner rounding. 0 = hard rectangle, 100px = pill button. |
| padding (CSS) | 14px 28px | Button size. Increase for a hero CTA (16px 40px) or decrease for inline use (8px 18px). |
| scale in :active (CSS) | 0.95 | Simulated press depth. 0.93 = pronounced press, 0.98 = gentle touch. Edit in the .snd-click-btn:active { transform: scale(...) } rule. |
| box-shadow in :hover (CSS) | rgba(99,102,241,0.4) 0px 4px 20px | Hover halo color and intensity. Change the rgba() to match your gradient color. |
| transition (CSS) | transform 0.15s, box-shadow 0.15s | Animation duration. 0.10 s = snappy, 0.25 s = smoother. Edit both values in the transition property. |
| .snd-wave content (HTML) | 🔊 | Icon in the .snd-wave span — replace the emoji with an inline SVG. The scale(1.3) animation still applies. |
| scale in .clicked .snd-wave (CSS) | 1.3 | Icon pulse amplitude when .clicked is added. 1.5 = pronounced flash, 1.15 = subtle. |
No — despite the name, the provided code is entirely CSS with no Web Audio API. It produces visual feedback only (scale on :active + hover glow + 🔊 icon pulse via .clicked). To add real sound: create an AudioContext, generate a short beep (oscillator.type = 'sine', 80 ms duration, 880 Hz) and fire it in the click listener alongside classList.add('clicked').
The CSS defines .snd-click-btn.clicked .snd-wave { transform: scale(1.3) } but the included code does not add it. Add this listener: btn.addEventListener('click', () => { btn.classList.add('clicked'); setTimeout(() => btn.classList.remove('clicked'), 250); }). Replace 250 with your desired transition duration.
Yes. Copy the CSS into your stylesheet (or CSS module). In React, replace direct classList manipulation with state: const [clicked, setClicked] = useState(false), pass className={clicked ? 'snd-click-btn clicked' : 'snd-click-btn'}, and trigger setClicked(true) then false after 250 ms in the onClick handler.