DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeAnimation / CSSButton Animation Generator

Example: Button Animation Generator

A worked example, rendered from real sample data. Sign in to run the tool on your own input.

Input
ripple
Output
.btn-ripple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  background: #3b82f6;
  color: #ffffff;
  font: 600 15px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 260ms ease;
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  opacity: 0;
}

.btn-ripple:active {
  background: color-mix(in srgb, #3b82f6 85%, black);
}

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

@keyframes btn-ripple {
  to { transform: scale(28); opacity: 0; }
}
.btn-ripple:active::after {
  animation: btn-ripple 600ms linear;
}

.btn-ripple:disabled,
.btn-ripple[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .btn-ripple, .btn-ripple::before, .btn-ripple::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* HTML: <button class="btn-ripple" type="button">Click me</button> */
/* Note: The ripple is purely CSS and starts from the centre. For a pointer-anchored ripple set --x/--y from a JS pointerdown handler. */

About Button Animation Generator

Button Animation Generator preview - Animation / CSS tool

Generate animated button styles with ripple, glow, and morphing effects. Part of the DevTools Surf developer suite. Browse more tools in the Animation / CSS collection.

Use Cases

  • Frontend developers building interactive form submit buttons
  • Component library authors creating reusable animated button primitives
  • Mobile web developers adding touch-friendly button feedback
  • E-commerce developers improving add-to-cart button engagement

Tips

  • Add a ripple effect origin at the click point for material feel
  • Use box-shadow transitions for glow effects instead of borders
  • Keep morphing animations under 400ms to feel snappy

Fun Facts

  • Google's Material Design ripple effect, introduced in 2014, was inspired by the physical world — ink spreading on paper. The original implementation required JavaScript to track click coordinates.
  • CSS :active state animations have existed since CSS2 (1998), but most button animations remained JavaScript-only until CSS transitions and animations gained full browser support around 2013.
  • The 'morphing button' pattern — where a button transforms into a loading spinner or success checkmark — was popularized by UI designers on Dribbble around 2015-2016.

FAQ

What animation styles?
Ripple (material-style click expansion), glow (pulsing shadow), morph (shape transition), lift (hover-up), and shine (gradient sweep).
Will it work without JavaScript?
Yes — all animations are pure CSS using @keyframes and transitions. Toggle hover, focus, and active states without any JS.
Does it respect prefers-reduced-motion?
Yes — the generated CSS includes a `@media (prefers-reduced-motion: reduce)` block that disables motion. Essential for accessibility.
Can I customize colors and timing?
Everything's a variable: --accent-color, --duration, --easing. Adjust in your theme to match your design system.

Related Animation / CSS Tools

CSS Keyframe GeneratorLoading Spinner GeneratorSkeleton Screen GeneratorHover Effect GeneratorCSS Transition PlaygroundText Animation GeneratorScroll Animation GeneratorParticle Effect Generator
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf919+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback