CSS Button Generator

Design accessible buttons with live hover preview, 15 presets, animation examples, and production-ready CSS.

Presets
Click any preset to instantly apply it

Classic

Special

Social

Live Preview

Light background

Hover to preview state

Dark background

disabled
focus-visible
Button Settings
Animation Recipes
Ready-to-use CSS animation patterns. Click each to preview the code.

Slide Fill

Background slides in from left on hover

css
.btn-slide {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: #3b82f6;
  border: 2px solid #3b82f6;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 0;
}

.btn-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #3b82f6;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: -1;
}

.btn-slide:hover {
  color: #ffffff;
}

.btn-slide:hover::before {
  transform: scaleX(1);
}
Generated CSS
css
.button {
  /* Layout */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;

  /* Colors */
  background-color: #3b82f6;
  color: #ffffff;
  border: none;

  /* Typography */
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;

  /* Shadow & Transition */
  box-shadow: 0 4px 14px rgba(59,130,246,0.4);
  cursor: pointer;
  transition: all 200ms ease;
  -webkit-user-select: none;
  user-select: none;
}

.button:hover,
.button:focus-visible {
  background-color: #2563eb;
  box-shadow: 0 6px 20px rgba(59,130,246,0.5);
  transform: scale(1.02);
}

.button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
HTML Usage
css
<button class="button" type="button">
  Get Started
</button>

Inline style equivalent

style="background:#3b82f6;color:#ffffff;border-radius:8px;padding:12px 24px;font-size:16px;font-weight:600"