Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
benjimich's hover button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By benjimich
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 benjimich's hover button
benjimich's hover button is an animated CSS button by benjimich. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, Animated
- 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="button">
<div class="line one">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line two">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line three">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line four">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line five">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line six">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
<div class="line seven">
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
<div class="round"></div>
</div>
</button>CSS
.button {
cursor: pointer;
background: none;
border: none;
display: flex;
flex-direction: column;
width: 70px;
gap: 4px;
}
.button:hover {
animation: move 2s infinite ease;
}
@keyframes move {
0% {
transform: translateX(0);
}
50% {
transform: translateX(20px);
}
100% {
transform: translateX(0);
}
}
.round {
width: 6px;
height: 6px;
background: #3da9fc;
border-radius: 50%;
}
.line {
display: flex;
gap: 4px;
}
.two {
transform: translateX(10px);
}
.three {
transform: translateX(20px);
}
.four {
transform: translateX(30px);
}
.five {
transform: translateX(20px);
}
.six {
transform: translateX(10px);
}