Live preview
Preview settings
Tailwind preview ready. Custom CSS is applied after utilities.
⌘ / Ctrl + S saves locally
StealthWorm's hover button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By StealthWorm
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 StealthWorm's hover button
StealthWorm's hover button is an animated Tailwind CSS v4 button by StealthWorm. 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="group cursor-pointer w-32 h-32 bg-red-600 active:bg-black group-active:bg-black rounded-full border-4 border-black flex relative items-center justify-center duration-300 transition-all hover:w-[8.4rem] hover:h-[8.4rem] ease-in-out">
<div class="absolute border-b-4 border-black w-full group-active:border-red-600 group-active:border-[2px]"></div>
<div class="absolute border-b-4 border-black w-full rotate-45 group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-b-4 border-black w-full rotate-90 group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-b-4 border-black w-full -rotate-45 group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-4 border-black w-4 h-4 bg-red-500 rounded-full group-active:bg-black"></div>
<div class="absolute border-[.2rem] border-black w-8 h-8 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-[.2rem] border-black w-12 h-12 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-[.2rem] border-black w-16 h-16 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-[.2rem] border-black w-20 h-20 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-[.2rem] border-black w-24 h-24 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="absolute border-[.2rem] border-black w-28 h-28 bg-transparent rounded-full group-active:border-red-600 group-active:border-[1px]"></div>
<div class="flex space-x-4 z-0">
<div class="bg-white w-12 h-12 rotate-45 border-t-[.6rem] border-b-[.4rem] border-l-8 border-r-2 border-black after:border-3 after:border-black rounded-full group-hover:border-t-[1rem] group-hover:border-b-[.6rem] group-active:border-red-600 group-active:border-y-[.4rem] group-active:border-x-[.1rem]">
<div class="border-b-3 border-black"></div>
</div>
<div class="bg-white w-12 h-12 -rotate-45 border-t-[.6rem] border-b-[.4rem] border-l-[.1rem] border-r-8 border-black after:border-3 after:border-black rounded-full group-hover:border-t-[1rem] group-hover:border-b-[.6rem] group-active:border-red-600 group-active:border-y-[.4rem] group-active:border-x-[.1rem]">
<div class="border-b-3 border-black"></div>
</div>
</div>
<div class="invisible absolute -top-14 group-hover:visible transition-all duration-200 delay-400">
<div class="absolute bg-gradient-to-b from-yellow-500 to-yellow-400 w-12 h-12 rotate-[25deg] left-4 top-2">
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -left-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -left-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -left-2 top-8"></div>
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -right-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -right-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -right-2 top-8"></div>
</div>
<div class="absolute bg-gradient-to-b from-yellow-500 to-yellow-400 w-12 h-12 -rotate-[25deg] -left-16 top-2">
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -left-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -left-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -left-2 top-8"></div>
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -right-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -right-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -right-2 top-8"></div>
</div>
<div class="absolute bg-gradient-to-b from-yellow-500 to-yellow-400 w-12 h-12 -rotate-[60deg] -left-[6.7rem] top-[3rem]">
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -left-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -left-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -left-2 top-8"></div>
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -right-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -right-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -right-2 top-8"></div>
</div>
<div class="absolute bg-gradient-to-b from-yellow-500 to-yellow-400 w-12 h-12 rotate-[60deg] left-[3.6rem] top-[3rem]">
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -left-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -left-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -left-2 top-8"></div>
<div class="absolute w-10 h-10 bg-[#212121] animate-spin -right-4 -top-4"></div>
<div class="absolute w-8 h-8 bg-[#212121] animate-spin -right-4 top-2"></div>
<div class="absolute w-4 h-4 bg-[#212121] animate-spin -right-2 top-8"></div>
</div>
</div>
</button>CSS
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
:root, :host {
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
"Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--color-red-500: oklch(63.7% 0.237 25.331);
--color-red-600: oklch(57.7% 0.245 27.325);
--color-yellow-400: oklch(85.2% 0.199 91.936);
--color-yellow-500: oklch(79.5% 0.184 86.047);
--color-black: #000;
--color-white: #fff;
--spacing: 0.25rem;
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
--animate-spin: spin 1s linear infinite;
--default-transition-duration: 150ms;
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
--default-font-family: var(--font-sans);
--default-mono-font-family: var(--font-mono);
}
}
@layer base {
*, ::after, ::before, ::backdrop, ::file-selector-button {
box-sizing: border-box;
margin: 0;
padding: 0;
border: 0 solid;
}
html, :host {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
tab-size: 4;
font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
font-feature-settings: var(--default-font-feature-settings, normal);
font-variation-settings: var(--default-font-variation-settings, normal);
-webkit-tap-highlight-color: transparent;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
-webkit-text-decoration: inherit;
text-decoration: inherit;
}
b, strong {
font-weight: bolder;
}
code, kbd, samp, pre {
font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
font-feature-settings: var(--default-mono-font-feature-settings, normal);
font-variation-settings: var(--default-mono-font-variation-settings, normal);
font-size: 1em;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
:-moz-focusring:where(:not(iframe)) {
outline: auto;
}
progress {
vertical-align: baseline;
}
summary {
display: list-item;
}
ol, ul, menu {
list-style: none;
}
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
}
img, video {
max-width: 100%;
height: auto;
}
button, input, select, optgroup, textarea, ::file-selector-button {
font: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
letter-spacing: inherit;
color: inherit;
border-radius: 0;
background-color: transparent;
opacity: 1;
}
:where(select:is([multiple], [size])) optgroup {
font-weight: bolder;
}
:where(select:is([multiple], [size])) optgroup option {
padding-inline-start: 20px;
}
::file-selector-button {
margin-inline-end: 4px;
}
::placeholder {
opacity: 1;
}
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
::placeholder {
color: currentcolor;
@supports (color: color-mix(in lab, red, red)) {
color: color-mix(in oklab, currentcolor 50%, transparent);
}
}
}
textarea {
resize: vertical;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-date-and-time-value {
min-height: 1lh;
text-align: inherit;
}
::-webkit-datetime-edit {
display: inline-flex;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
padding-block: 0;
}
::-webkit-calendar-picker-indicator {
line-height: 1;
}
:-moz-ui-invalid {
box-shadow: none;
}
button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
appearance: button;
}
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
display: none !important;
}
}
@layer utilities {
.invisible {
visibility: hidden;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.-top-4 {
top: calc(var(--spacing) * -4);
}
.-top-14 {
top: calc(var(--spacing) * -14);
}
.top-2 {
top: calc(var(--spacing) * 2);
}
.top-8 {
top: calc(var(--spacing) * 8);
}
.top-\[3rem\] {
top: 3rem;
}
.-right-2 {
right: calc(var(--spacing) * -2);
}
.-right-4 {
right: calc(var(--spacing) * -4);
}
.-left-2 {
left: calc(var(--spacing) * -2);
}
.-left-4 {
left: calc(var(--spacing) * -4);
}
.-left-16 {
left: calc(var(--spacing) * -16);
}
.-left-\[6\.7rem\] {
left: calc(6.7rem * -1);
}
.left-4 {
left: calc(var(--spacing) * 4);
}
.left-\[3\.6rem\] {
left: 3.6rem;
}
.z-0 {
z-index: 0;
}
.flex {
display: flex;
}
.h-4 {
height: calc(var(--spacing) * 4);
}
.h-8 {
height: calc(var(--spacing) * 8);
}
.h-10 {
height: calc(var(--spacing) * 10);
}
.h-12 {
height: calc(var(--spacing) * 12);
}
.h-16 {
height: calc(var(--spacing) * 16);
}
.h-20 {
height: calc(var(--spacing) * 20);
}
.h-24 {
height: calc(var(--spacing) * 24);
}
.h-28 {
height: calc(var(--spacing) * 28);
}
.h-32 {
height: calc(var(--spacing) * 32);
}
.w-4 {
width: calc(var(--spacing) * 4);
}
.w-8 {
width: calc(var(--spacing) * 8);
}
.w-10 {
width: calc(var(--spacing) * 10);
}
.w-12 {
width: calc(var(--spacing) * 12);
}
.w-16 {
width: calc(var(--spacing) * 16);
}
.w-20 {
width: calc(var(--spacing) * 20);
}
.w-24 {
width: calc(var(--spacing) * 24);
}
.w-28 {
width: calc(var(--spacing) * 28);
}
.w-32 {
width: calc(var(--spacing) * 32);
}
.w-full {
width: 100%;
}
.-rotate-45 {
rotate: calc(45deg * -1);
}
.-rotate-\[25deg\] {
rotate: calc(25deg * -1);
}
.-rotate-\[60deg\] {
rotate: calc(60deg * -1);
}
.rotate-45 {
rotate: 45deg;
}
.rotate-90 {
rotate: 90deg;
}
.rotate-\[25deg\] {
rotate: 25deg;
}
.rotate-\[60deg\] {
rotate: 60deg;
}
.animate-spin {
animation: var(--animate-spin);
}
.cursor-pointer {
cursor: pointer;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
:where(.space-x-4 > :not(:last-child)) {
--tw-space-x-reverse: 0;
margin-inline-start: calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
}
.rounded-full {
border-radius: calc(infinity * 1px);
}
.border-4 {
border-style: var(--tw-border-style);
border-width: 4px;
}
.border-\[\.2rem\] {
border-style: var(--tw-border-style);
border-width: .2rem;
}
.border-t-\[\.6rem\] {
border-top-style: var(--tw-border-style);
border-top-width: .6rem;
}
.border-r-2 {
border-right-style: var(--tw-border-style);
border-right-width: 2px;
}
.border-r-8 {
border-right-style: var(--tw-border-style);
border-right-width: 8px;
}
.border-b-3 {
border-bottom-style: var(--tw-border-style);
border-bottom-width: 3px;
}
.border-b-4 {
border-bottom-style: var(--tw-border-style);
border-bottom-width: 4px;
}
.border-b-\[\.4rem\] {
border-bottom-style: var(--tw-border-style);
border-bottom-width: .4rem;
}
.border-l-8 {
border-left-style: var(--tw-border-style);
border-left-width: 8px;
}
.border-l-\[\.1rem\] {
border-left-style: var(--tw-border-style);
border-left-width: .1rem;
}
.border-black {
border-color: var(--color-black);
}
.bg-\[\#212121\] {
background-color: #212121;
}
.bg-red-500 {
background-color: var(--color-red-500);
}
.bg-red-600 {
background-color: var(--color-red-600);
}
.bg-transparent {
background-color: transparent;
}
.bg-white {
background-color: var(--color-white);
}
.bg-gradient-to-b {
--tw-gradient-position: to bottom in oklab;
background-image: linear-gradient(var(--tw-gradient-stops));
}
.from-yellow-500 {
--tw-gradient-from: var(--color-yellow-500);
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
}
.to-yellow-400 {
--tw-gradient-to: var(--color-yellow-400);
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
}
.transition-all {
transition-property: all;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.delay-400 {
transition-delay: 400ms;
}
.duration-200 {
--tw-duration: 200ms;
transition-duration: 200ms;
}
.duration-300 {
--tw-duration: 300ms;
transition-duration: 300ms;
}
.ease-in-out {
--tw-ease: var(--ease-in-out);
transition-timing-function: var(--ease-in-out);
}
@media (hover: hover) {
.group-hover\:visible:is(:where(.group):hover *) {
visibility: visible;
}
.group-hover\:border-t-\[1rem\]:is(:where(.group):hover *) {
border-top-style: var(--tw-border-style);
border-top-width: 1rem;
}
.group-hover\:border-b-\[\.6rem\]:is(:where(.group):hover *) {
border-bottom-style: var(--tw-border-style);
border-bottom-width: .6rem;
}
}
.group-active\:border-\[1px\]:is(:where(.group):active *) {
border-style: var(--tw-border-style);
border-width: 1px;
}
.group-active\:border-\[2px\]:is(:where(.group):active *) {
border-style: var(--tw-border-style);
border-width: 2px;
}
.group-active\:border-x-\[\.1rem\]:is(:where(.group):active *) {
border-inline-style: var(--tw-border-style);
border-inline-width: .1rem;
}
.group-active\:border-y-\[\.4rem\]:is(:where(.group):active *) {
border-block-style: var(--tw-border-style);
border-block-width: .4rem;
}
.group-active\:border-red-600:is(:where(.group):active *) {
border-color: var(--color-red-600);
}
.group-active\:bg-black:is(:where(.group):active *) {
background-color: var(--color-black);
}
.after\:border-3::after {
content: var(--tw-content);
border-style: var(--tw-border-style);
border-width: 3px;
}
.after\:border-black::after {
content: var(--tw-content);
border-color: var(--color-black);
}
@media (hover: hover) {
.hover\:h-\[8\.4rem\]:hover {
height: 8.4rem;
}
.hover\:w-\[8\.4rem\]:hover {
width: 8.4rem;
}
}
.active\:bg-black:active {
background-color: var(--color-black);
}
}
@property --tw-space-x-reverse {
syntax: "*";
inherits: false;
initial-value: 0;
}
@property --tw-border-style {
syntax: "*";
inherits: false;
initial-value: solid;
}
@property --tw-gradient-position {
syntax: "*";
inherits: false;
}
@property --tw-gradient-from {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}
@property --tw-gradient-via {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}
@property --tw-gradient-to {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}
@property --tw-gradient-stops {
syntax: "*";
inherits: false;
}
@property --tw-gradient-via-stops {
syntax: "*";
inherits: false;
}
@property --tw-gradient-from-position {
syntax: "<length-percentage>";
inherits: false;
initial-value: 0%;
}
@property --tw-gradient-via-position {
syntax: "<length-percentage>";
inherits: false;
initial-value: 50%;
}
@property --tw-gradient-to-position {
syntax: "<length-percentage>";
inherits: false;
initial-value: 100%;
}
@property --tw-duration {
syntax: "*";
inherits: false;
}
@property --tw-ease {
syntax: "*";
inherits: false;
}
@property --tw-content {
syntax: "*";
initial-value: "";
inherits: false;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
--tw-space-x-reverse: 0;
--tw-border-style: solid;
--tw-gradient-position: initial;
--tw-gradient-from: #0000;
--tw-gradient-via: #0000;
--tw-gradient-to: #0000;
--tw-gradient-stops: initial;
--tw-gradient-via-stops: initial;
--tw-gradient-from-position: 0%;
--tw-gradient-via-position: 50%;
--tw-gradient-to-position: 100%;
--tw-duration: initial;
--tw-ease: initial;
--tw-content: "";
}
}
}