Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Animated Confirmation Button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
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 Animated Confirmation Button
Animated Confirmation Button is an animated CSS button by @0xabdulkhalid. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, Toggle, Icon
- 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Animated Confirmation Button</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="checkbox-wrapper">
<input type="checkbox"/>
<svg viewBox="0 0 35.6 35.6">
<circle class="background" cx="17.8" cy="17.8" r="17.8"></circle>
<circle class="stroke" cx="17.8" cy="17.8" r="14.37"></circle>
<polyline class="check" points="11.78 18.12 15.55 22.23 25.17 12.87"></polyline>
</svg>
</div>
</body>
</html>
CSS
body {
min-height: 100vh;
display: grid;
place-items: center;
background: #222;
}
.checkbox-wrapper:hover .check {
stroke-dashoffset: 0;
}
.checkbox-wrapper {
transform: scale(2);
position: relative;
display: inline-block;
width: 40px;
height: 40px;
}
.checkbox-wrapper .background {
fill: #ccc;
transition: ease all 0.6s;
-webkit-transition: ease all 0.6s;
}
.checkbox-wrapper .stroke {
fill: none;
stroke: #fff;
stroke-miterlimit: 10;
stroke-width: 2px;
stroke-dashoffset: 100;
stroke-dasharray: 100;
transition: ease all 0.6s;
-webkit-transition: ease all 0.6s;
}
.checkbox-wrapper .check {
fill: none;
stroke: #fff;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 2px;
stroke-dashoffset: 22;
stroke-dasharray: 22;
transition: ease all 0.6s;
-webkit-transition: ease all 0.6s;
}
.checkbox-wrapper input[type=checkbox] {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
margin: 0;
opacity: 0;
-appearance: none;
-webkit-appearance: none;
}
.checkbox-wrapper input[type=checkbox]:hover {
cursor: pointer;
}
.checkbox-wrapper input[type=checkbox]:checked + svg .background {
fill: #6cbe45;
}
.checkbox-wrapper input[type=checkbox]:checked + svg .stroke {
stroke-dashoffset: 0;
}
.checkbox-wrapper input[type=checkbox]:checked + svg .check {
stroke-dashoffset: 0;
}