Keyframe Animation Builder

Bring your UI to life. Visually configure your start, middle, and end states using hardware-accelerated properties to generate buttery-smooth CSS animations.

/* Generated on cssgen.org */

Choreographing UI with @keyframes

A simple hover transition is great for a button changing color, but what if you want an element to pulse continuously, or slide in and bounce when a page loads? That requires the @keyframes CSS rule.

Keyframes allow you to define the exact style of an element at specific waypoints (like 0%, 50%, and 100%) during an animation cycle. The browser mathematically interpolates the steps in between, creating a smooth motion. Read the complete technical specification on the MDN Web Docs.

🚀

Performance & Core Web Vitals

  • Only Animate Compositor Properties: Notice how our tool only allows you to change Scale, Rotate, Translate, and Opacity? These are the only properties you should ever animate. They are processed directly by the GPU. Animating properties like margin-top or width forces the CPU to recalculate the page layout every single frame, causing severe jank.
  • The "Bouncy" Easing: Standard easings like ease-in-out are great, but a custom cubic-bezier curve can make an animation overshoot its target and snap back, creating a playful "bouncy" effect without needing extra keyframe steps.
  • Infinite Alternate: If you are building a floating or pulsing effect, always pair the infinite iteration count with the alternate direction. This makes the animation play forward, then backward, creating a seamless, endless loop.

Frequently Asked Questions

How do CSS @keyframes work?

The @keyframes CSS rule controls the intermediate steps in a CSS animation sequence by establishing waypoints (0%, 50%, 100%) along the animation cycle. You define styles at these waypoints, and the browser smoothly transitions the element between them.

Why is my CSS animation jittery or lagging?

You are likely animating a property that triggers a layout recalculation, such as width, height, top, left, or margin. To fix the lag, rewrite your animation to strictly use the transform: translate() and transform: scale() properties, which are hardware-accelerated.

What is the difference between transition and animation in CSS?

A transition is a simple A-to-B shift triggered by a state change (like a user hovering over a button). An animation (using @keyframes) can have infinite intermediate steps (A-to-B-to-C-to-D), can loop infinitely, and can play automatically on page load without user interaction.