Presets

CSS button animations

6 buttons with ready-to-paste CSS code.

01 Loading button loop
Loading button · CSS Tune →
.loading-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: #d4ff3a;
  color: #0b0b0c;
  border-radius: 10px;
}

.loading-button__spinner {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 2px solid #0b0b0c40;
  border-top-color: #0b0b0c;
  border-radius: 50%;
  animation: loading-button-spin 0.8s linear infinite;
}

@keyframes loading-button-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
02 Shine sweep button loop
Shine sweep button · CSS Tune →
.shine {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #d4ff3a;
  color: #0b0b0c;
  border-radius: 10px;
}

.shine__shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  pointer-events: none;
  animation: shine-sweep 2.8s ease-in-out infinite;
}

@keyframes shine-sweep {
  0% { transform: translateX(-150%) skewX(-20deg); }
  45%, 100% { transform: translateX(350%) skewX(-20deg); }
}
03 Pulse glow button loop
Pulse glow button · CSS Tune →
.pulse-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: #d4ff3a;
  color: #0b0b0c;
  border-radius: 999px;
  animation: pulse-glow-pulse 2s ease-out infinite;
}

@keyframes pulse-glow-pulse {
  0% { box-shadow: 0 0 0 0px #d4ff3a8c; }
  70% { box-shadow: 0 0 0 16px #d4ff3a00; }
  100% { box-shadow: 0 0 0 0px #d4ff3a00; }
}
04 3D press button press
3D press button · CSS Tune →
.press {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: #d4ff3a;
  color: #0b0b0c;
  border-radius: 12px;
  transform: translateY(0px);
  box-shadow: 0 6px 0 0 #7a9a00;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.press:active {
  transform: translateY(6px);
  box-shadow: 0 0px 0 0 #7a9a00;
}
05 Border draw button hover
Border draw button · CSS Tune →
.border-draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  position: relative;
  background: transparent;
  color: #f2f2f2;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #f2f2f233;
}

.border-draw__frame {
  position: absolute;
  inset: 0;
  border: 2px solid #d4ff3a;
  border-radius: 10px;
  clip-path: inset(0% 100% 100% 0%);
  pointer-events: none;
  transition: clip-path 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.border-draw:hover .border-draw__frame {
  clip-path: inset(0% 0% 0% 0%);
}
06 Gradient shift button loop
Gradient shift button · CSS Tune →
.gradient-shift {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  color: #0b0b0c;
  border-radius: 10px;
  background: linear-gradient(90deg, #d4ff3a, #3ad8ff, #b07cff);
  background-size: 300% 300%;
  animation: gradient-shift-shift 3s ease-in-out infinite alternate;
}

@keyframes gradient-shift-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

These button animation examples are plain HTML and CSS: a native button element, a class per part, and either a keyframe for looping effects or a transition for interactive states. No JavaScript is needed for any of them.

Looping animations like the Shine sweep, Pulse glow and Gradient shift use @keyframes with a built-in pause or alternate direction so they never jump. Interactive ones are transitions on a state selector: the 3D press button uses :active to move the face down by its edge depth, and Border draw transitions clip-path on :hover. The Loading button pairs a border spinner with aria-busy for the in-progress state.

Change the label, colors, corner radius and timing in the editor, and the CSS updates live with your values written in. Class names are prefixed with the preset name, so you can paste several of them into one stylesheet without conflicts. Add :focus-visible next to any :hover rule so keyboard users see the same effect.

How do I add a CSS animation to an existing button?

Copy the CSS rules and add the preset's class names to your button and its child elements, or rename the classes to match yours. For single-element effects like Pulse glow and 3D press, only the button class is needed. Shine and Border draw need one extra child element for the streak or frame.

How do I trigger a CSS button animation on click?

Use :active for an effect while the button is held, like the 3D press. For an animation that plays after a click, add a class in your click handler and remove it on animationend so it can replay. For a busy state, toggle aria-busy and style the spinner from [aria-busy="true"].

Can I combine two button animations?

Yes, as long as they animate different properties. A Shine sweep (transform on a child) combines well with a 3D press (transform and box-shadow on the button). Two effects that both set box-shadow on the same element, like Pulse glow and 3D press, will override each other unless you merge the shadow values.