Back to buttons

Live preview

Preview settings

Tailwind preview ready. Custom CSS is applied after utilities.

⌘ / Ctrl + S saves locally

See more · Javierrocadev

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By Javierrocadev

Remix button

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 See more · Javierrocadev

See more · Javierrocadev is an animated Tailwind CSS v4 button by Javierrocadev. 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="group group-hover:before:duration-500 group-hover:after:duration-500 after:duration-500 hover:border-rose-300 hover:before:[box-shadow:_20px_20px_20px_30px_#a21caf] duration-500 before:duration-500 hover:duration-500 underline underline-offset-2 hover:after:-right-8 hover:before:right-12 hover:before:-bottom-8 hover:before:blur hover:underline hover:underline-offset-4  origin-left hover:decoration-2 hover:text-rose-300 relative bg-neutral-800 h-16 w-64 border text-left p-3 text-gray-50 text-base font-bold rounded-lg  overflow-hidden  before:absolute before:w-12 before:h-12 before:content[''] before:right-1 before:top-1 before:z-10 before:bg-violet-500 before:rounded-full before:blur-lg  after:absolute after:z-10 after:w-20 after:h-20 after:content['']  after:bg-rose-300 after:right-8 after:top-3 after:rounded-full after:blur-lg">
  See more
</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-violet-500: oklch(60.6% 0.25 292.717);
    --color-rose-300: oklch(81% 0.117 11.638);
    --color-gray-50: oklch(98.5% 0.002 247.839);
    --color-neutral-800: oklch(26.9% 0 none);
    --spacing: 0.25rem;
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --font-weight-bold: 700;
    --radius-lg: 0.5rem;
    --blur-lg: 16px;
    --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 {
  .relative {
    position: relative;
  }
  .h-16 {
    height: calc(var(--spacing) * 16);
  }
  .w-64 {
    width: calc(var(--spacing) * 64);
  }
  .origin-left {
    transform-origin: 0;
  }
  .overflow-hidden {
    overflow: hidden;
  }
  .rounded-lg {
    border-radius: var(--radius-lg);
  }
  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }
  .bg-neutral-800 {
    background-color: var(--color-neutral-800);
  }
  .p-3 {
    padding: calc(var(--spacing) * 3);
  }
  .text-left {
    text-align: left;
  }
  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }
  .font-bold {
    --tw-font-weight: var(--font-weight-bold);
    font-weight: var(--font-weight-bold);
  }
  .text-gray-50 {
    color: var(--color-gray-50);
  }
  .underline {
    text-decoration-line: underline;
  }
  .underline-offset-2 {
    text-underline-offset: 2px;
  }
  .duration-500 {
    --tw-duration: 500ms;
    transition-duration: 500ms;
  }
  .before\:absolute::before {
    content: var(--tw-content);
    position: absolute;
  }
  .before\:top-1::before {
    content: var(--tw-content);
    top: var(--spacing);
  }
  .before\:right-1::before {
    content: var(--tw-content);
    right: var(--spacing);
  }
  .before\:z-10::before {
    content: var(--tw-content);
    z-index: 10;
  }
  .before\:h-12::before {
    content: var(--tw-content);
    height: calc(var(--spacing) * 12);
  }
  .before\:w-12::before {
    content: var(--tw-content);
    width: calc(var(--spacing) * 12);
  }
  .before\:rounded-full::before {
    content: var(--tw-content);
    border-radius: calc(infinity * 1px);
  }
  .before\:bg-violet-500::before {
    content: var(--tw-content);
    background-color: var(--color-violet-500);
  }
  .before\:blur-lg::before {
    content: var(--tw-content);
    --tw-blur: blur(var(--blur-lg));
    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
  }
  .before\:duration-500::before {
    content: var(--tw-content);
    --tw-duration: 500ms;
    transition-duration: 500ms;
  }
  @media (hover: hover) {
    .group-hover\:before\:duration-500:is(:where(.group):hover *)::before {
      content: var(--tw-content);
      --tw-duration: 500ms;
      transition-duration: 500ms;
    }
  }
  .after\:absolute::after {
    content: var(--tw-content);
    position: absolute;
  }
  .after\:top-3::after {
    content: var(--tw-content);
    top: calc(var(--spacing) * 3);
  }
  .after\:right-8::after {
    content: var(--tw-content);
    right: calc(var(--spacing) * 8);
  }
  .after\:z-10::after {
    content: var(--tw-content);
    z-index: 10;
  }
  .after\:h-20::after {
    content: var(--tw-content);
    height: calc(var(--spacing) * 20);
  }
  .after\:w-20::after {
    content: var(--tw-content);
    width: calc(var(--spacing) * 20);
  }
  .after\:rounded-full::after {
    content: var(--tw-content);
    border-radius: calc(infinity * 1px);
  }
  .after\:bg-rose-300::after {
    content: var(--tw-content);
    background-color: var(--color-rose-300);
  }
  .after\:blur-lg::after {
    content: var(--tw-content);
    --tw-blur: blur(var(--blur-lg));
    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
  }
  .after\:duration-500::after {
    content: var(--tw-content);
    --tw-duration: 500ms;
    transition-duration: 500ms;
  }
  @media (hover: hover) {
    .group-hover\:after\:duration-500:is(:where(.group):hover *)::after {
      content: var(--tw-content);
      --tw-duration: 500ms;
      transition-duration: 500ms;
    }
    .hover\:border-rose-300:hover {
      border-color: var(--color-rose-300);
    }
    .hover\:text-rose-300:hover {
      color: var(--color-rose-300);
    }
    .hover\:underline:hover {
      text-decoration-line: underline;
    }
    .hover\:decoration-2:hover {
      text-decoration-thickness: 2px;
    }
    .hover\:underline-offset-4:hover {
      text-underline-offset: 4px;
    }
    .hover\:duration-500:hover {
      --tw-duration: 500ms;
      transition-duration: 500ms;
    }
    .hover\:before\:right-12:hover::before {
      content: var(--tw-content);
      right: calc(var(--spacing) * 12);
    }
    .hover\:before\:-bottom-8:hover::before {
      content: var(--tw-content);
      bottom: calc(var(--spacing) * -8);
    }
    .hover\:before\:\[box-shadow\:_20px_20px_20px_30px_\#a21caf\]:hover::before {
      content: var(--tw-content);
      box-shadow:  20px 20px 20px 30px #a21caf;
    }
    .hover\:before\:blur:hover::before {
      content: var(--tw-content);
      --tw-blur: blur(8px);
      filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
    }
    .hover\:after\:-right-8:hover::after {
      content: var(--tw-content);
      right: calc(var(--spacing) * -8);
    }
  }
}
@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@property --tw-font-weight {
  syntax: "*";
  inherits: false;
}
@property --tw-duration {
  syntax: "*";
  inherits: false;
}
@property --tw-content {
  syntax: "*";
  initial-value: "";
  inherits: false;
}
@property --tw-blur {
  syntax: "*";
  inherits: false;
}
@property --tw-brightness {
  syntax: "*";
  inherits: false;
}
@property --tw-contrast {
  syntax: "*";
  inherits: false;
}
@property --tw-grayscale {
  syntax: "*";
  inherits: false;
}
@property --tw-hue-rotate {
  syntax: "*";
  inherits: false;
}
@property --tw-invert {
  syntax: "*";
  inherits: false;
}
@property --tw-opacity {
  syntax: "*";
  inherits: false;
}
@property --tw-saturate {
  syntax: "*";
  inherits: false;
}
@property --tw-sepia {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false;
}
@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-border-style: solid;
      --tw-font-weight: initial;
      --tw-duration: initial;
      --tw-content: "";
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
    }
  }
}