Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Ripple · SelfMadeSystem
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By SelfMadeSystem
Button submission checks
Checks will appear after the preview updates.
Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.
Accessibility quick check
Waiting for the rendered preview…
Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.
Explore freely here. Remix to publish your version with credit to the creator.
About Ripple · SelfMadeSystem
Ripple · SelfMadeSystem is an animated CSS button by SelfMadeSystem. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects
- Using this example
- Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.
Usage, Tailwind and licensing questions
Read the source files
HTML
<button class="btn">
<span>Ripple</span>
<div class="ripple-container">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</button>CSS
.btn {
border-radius: 0.5em;
font-size: larger;
height: 3em;
width: 6em;
position: relative;
border: none;
background-color: hsl(218, 68%, 52%);
overflow: hidden;
isolation: isolate;
color: white;
box-shadow: 1px 2px 4px #0007;
transition: background-color 0.2s;
}
.btn:hover {
background-color: hsl(218, 68%, 47%);
}
.btn > span {
position: relative;
pointer-events: none;
z-index: 10;
}
.ripple-container {
position: absolute;
inset: 0;
display: grid;
grid-template-columns: repeat(12, 0.5em);
}
.ripple-container > span {
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.ripple-container > span::after {
content: "";
pointer-events: none;
position: absolute;
background-color: hsl(218, 68%, 65%);
transition: width 0.5s ease-out, height 0.5s ease-out, opacity 1s;
width: 13em;
height: 13em;
opacity: 0;
border-radius: 999em;
}
.ripple-container > span:active::after {
transition: 0s;
width: 0em;
height: 0em;
opacity: 1;
}
/*
Use this instead if you want the ripple to start
immediately on click but end abruptly on unclick:
.ripple-container > span::after {
content: "";
pointer-events: none;
position: absolute;
background-color: hsl(218, 68%, 65%);
width: 0em;
height: 0em;
border-radius: 999em;
opacity: 1;
}
.ripple-container > span:active::after {
transition: width 0.25s ease-out, height 0.25s ease-out, opacity 0.75s;
width: 13em;
height: 13em;
opacity: 0;
}
Your Global selectors gets triggered by this:
*/