Back to buttons

Live preview

Preview settings

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

⌘ / Ctrl + S saves locally

upload Button

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

By @Gurnav224

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 upload Button

upload Button is an animated CSS button by @Gurnav224. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, Toggle, Icon, 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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>upload Button</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <main class="container">
        <input type="checkbox" id="button" class="hidden">
        <label for="button" class="button">Upload</label>
        <img src="https://cdn0.iconfinder.com/data/icons/TWG_Retina_Icons/64/checkmark.png" >
        <svg class="circle">
            <circle cx="30" cy="30" r="29"></circle>
        </svg>
    </main>
</body>
</html>

CSS


@import url(https://fonts.googleapis.com/css?family=Open+Sans:600);
body {
	background: #2e2a31;
    overflow: hidden;
}

.container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
  box-shadow: .5rem .5rem 1rem rgba(0, 0, 0, 0.6);
  overflow: hidden;
  background: #27242c;
  color: #fff;
  font-family: 'Open Sans', Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none;
}

.button {
    background-color: #2c4d53;
  box-sizing: border-box;
  position: absolute;
  display: block;
  width: 260px;
  height: 60px;
  top: 170px;
  left: 70px;
  border: 2px solid #fff;
  border-radius: 30px;
  text-align: center;
  line-height: 56px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all .3s ease-in-out;
  cursor: pointer;
}

.button:hover {
  background: fade-out(#3a717a, .6);
}

img {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
	transform: translate(-50%, -50%);
  opacity: 0;
	width: 1.8rem;
}

.circle {
  position: absolute;
  width: 60px;
  height: 60px;
  z-index: 2;
  top: 170px;
  left: 170px;
  fill: none;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-dasharray: 183 183;
  stroke-dashoffset: 183;
  pointer-events: none;
          transform: rotate(-90deg);
}

input:checked ~ .button {
          animation: button .5s ease both, fill .5s ease-out 1.5s forwards;
}
input:checked ~  img {
          animation: check .5s ease-out 1.5s both;
}
input:checked ~ .circle {
          animation: circle 2s ease-out .5s both;
}

@keyframes button {
  0% {
    width: 260px;
    left: 70px;
    border-color: #fff;
    color: #fff;
  }
  50% {
    color: transparent;
  }
  100% {
    width: 60px;
    left: 170px;
    border-color: #643a7a;
    background: transparent;
    color: transparent;
  }
}

@keyframes circle {
  0% {
    stroke-dashoffset: 183;
  }
  50% {
    stroke-dashoffset: 0;
    stroke-dasharray: 183;
            transform: rotate(-90deg) scale(1);
    opacity: 1;
  }
  90%, 100% {
    stroke-dasharray: 500 500;
            transform: rotate(-90deg) scale(2);
    opacity: 0;
  }
}

@keyframes fill {
  0% {
    background: transparent;
    border-color: #fff;
  }
  100% {
    background: transparent;
  }
}

@keyframes check {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}