Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

Vidip-Ghosh's button

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

By @Vidip-Ghosh

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 Vidip-Ghosh's button

Vidip-Ghosh's button is an animated CSS button by @Vidip-Ghosh. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, 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" />
    <title>Document</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div
      class="container d-flex justify-content-center align-items-center mt-5"
    >
      <a href="#" class="btn p-3"
        >Swipe Next<span
          ><ion-icon name="chevron-forward-outline"></ion-icon></span
      ></a>
    </div>
    <script
      type="module"
      src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"
    ></script>
    <script
      nomodule
      src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"
    ></script>
  </body>
</html>

CSS


body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #28272a;
    height: 100vh;
  }
  .btn {
    position: relative;
    width: 200px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    letter-spacing: 2px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.35);
    border-left: 0.5px solid rgba(255, 255, 255, 0.35);
    padding-left: 40px;
    transition: 0.5s;
    overflow: hidden;
  }
  .btn:hover {
    padding-left: 0px;
    padding-right: 40px;
    color: rgba(255, 255, 255, 1);
  }
  .btn span {
    position: absolute;
    left: 5px;
    width: 50px;
    height: 50px;
    background-color: #04fe4d;
    border-radius: 50%;
    transition: 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1a191d;
    font-weight: bolder;
    font-size: 1.6rem;
  }
  .btn:hover span {
    left: calc(100% - 55px);
  }
  .btn::after {
    content: "";
    position: absolute;
    width: 80px;
    height: 100%;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-170px) skewX(30deg);
    transition: 0.75s ease-in-out;
  }
  .btn:hover::after {
    transform: translateX(170px) skewX(30deg);
  }