animate.css
🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.
Top Related Projects
🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.
CSS3 Animations with special effects
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Tasty CSS-animated Hamburgers
JavaScript animation engine
A simple library to take care of complicated animations.
Quick Overview
Animate.css is a popular, ready-to-use CSS animation library. It provides a collection of cross-browser animations that can be easily applied to HTML elements, making it simple to add engaging animations to websites and web applications without writing complex CSS keyframes from scratch.
Pros
- Easy to use with minimal setup required
- Wide variety of pre-built animations
- Cross-browser compatible
- Lightweight and performant
Cons
- Limited customization options for animations
- May lead to overuse of animations if not applied judiciously
- Some animations might be too flashy for certain professional contexts
Code Examples
Adding a fade-in animation to an element:
<h1 class="animate__animated animate__fadeIn">Hello, World!</h1>
Applying a bounce animation with a delay:
<div class="animate__animated animate__bounce animate__delay-2s">
Bouncing element
</div>
Using JavaScript to add animations dynamically:
document.querySelector('.my-element').classList.add('animate__animated', 'animate__shakeX');
Getting Started
- Include the Animate.css stylesheet in your HTML:
<head>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
</head>
- Add the
animate__animated
class and the desired animation class to your HTML element:
<div class="animate__animated animate__fadeIn">
This element will fade in
</div>
- Customize animation duration, delay, and repeat count using utility classes:
<div class="animate__animated animate__fadeIn animate__faster animate__delay-2s animate__repeat-2">
Customized animation
</div>
Competitor Comparisons
🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.
Pros of animate.css
- Widely adopted and well-established library
- Extensive collection of pre-built animations
- Easy to implement with simple CSS classes
Cons of animate.css
- Larger file size due to comprehensive animation set
- May require additional customization for specific needs
- Some animations might be considered outdated or overused
Code Comparison
animate.css:
.animate__animated {
animation-duration: 1s;
animation-fill-mode: both;
}
.animate__bounce {
animation-name: bounce;
transform-origin: center bottom;
}
Both repositories appear to be the same project (animate.css), so there isn't a distinct code comparison to make. The animate.css library provides a set of ready-to-use CSS animations that can be easily applied to HTML elements using classes.
Key Features
- Cross-browser compatibility
- Customizable animation duration and delay
- Supports both CSS and JavaScript implementation
- Regularly maintained and updated
Use Cases
- Adding subtle animations to user interfaces
- Creating engaging landing pages
- Enhancing user experience in web applications
- Quickly prototyping animation ideas
animate.css is a versatile and popular choice for web developers looking to add animations to their projects without writing complex CSS or JavaScript animations from scratch.
CSS3 Animations with special effects
Pros of Magic
- Smaller file size, making it more lightweight
- Includes unique animations not found in Animate.css
- Easier to customize with SCSS variables
Cons of Magic
- Fewer animation options compared to Animate.css
- Less widespread adoption and community support
- Limited browser compatibility for some animations
Code Comparison
Magic:
.magic {
animation-name: magic;
animation-duration: 1s;
}
@keyframes magic {
0% {
opacity: 0;
transform: scale(0) rotate(720deg);
}
100% {
opacity: 1;
transform: scale(1) rotate(0deg);
}
}
Animate.css:
.animate__animated {
animation-duration: 1s;
animation-fill-mode: both;
}
.animate__fadeIn {
animation-name: fadeIn;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
Both libraries offer easy-to-use CSS animations, but Magic focuses on more complex, eye-catching effects, while Animate.css provides a wider range of simpler animations. The code examples show the difference in complexity and approach between the two libraries.
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Pros of Hover
- Focuses specifically on hover effects, providing a more specialized set of animations
- Includes SASS/SCSS files for easier customization and integration into existing projects
- Offers a wider variety of 2D transforms and transition effects
Cons of Hover
- Limited to hover-based animations, less versatile for general-purpose use
- Smaller community and fewer updates compared to Animate.css
- Requires more setup and configuration to implement effectively
Code Comparison
Hover:
.hvr-grow {
display: inline-block;
vertical-align: middle;
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
backface-visibility: hidden;
}
Animate.css:
.animate__animated {
animation-duration: 1s;
animation-fill-mode: both;
}
.animate__bounce {
animation-name: bounce;
transform-origin: center bottom;
}
Both libraries offer easy-to-use CSS classes for animations, but Hover focuses on hover effects with more detailed transforms, while Animate.css provides a broader range of general-purpose animations with simpler implementation.
Tasty CSS-animated Hamburgers
Pros of Hamburgers
- Focused specifically on hamburger menu animations
- Highly customizable with Sass variables
- Lightweight and modular, allowing for selective imports
Cons of Hamburgers
- Limited to hamburger menu animations only
- Requires Sass compilation for full customization
- Smaller community and fewer updates compared to Animate.css
Code Comparison
Hamburgers:
.hamburger {
padding: 15px;
display: inline-block;
cursor: pointer;
transition-property: opacity, filter;
transition-duration: 0.15s;
transition-timing-function: linear;
}
Animate.css:
.animate__animated {
animation-duration: 1s;
animation-fill-mode: both;
}
.animate__bounce {
animation-name: bounce;
transform-origin: center bottom;
}
Hamburgers focuses on specific hamburger menu styles with detailed SCSS, while Animate.css provides a broader range of animations using simpler CSS classes. Hamburgers offers more granular control over hamburger menu animations, whereas Animate.css provides a wider variety of general-purpose animations that can be easily applied to various elements.
JavaScript animation engine
Pros of Anime
- More flexible and customizable animations with JavaScript API
- Supports SVG animations and transformations
- Smaller file size and better performance for complex animations
Cons of Anime
- Steeper learning curve due to JavaScript-based approach
- Requires JavaScript to function, unlike CSS-only solutions
- Less suitable for simple, quick animations
Code Comparison
Animate.css (CSS-based):
.element {
animation: fadeIn 1s;
}
Anime (JavaScript-based):
anime({
targets: '.element',
opacity: [0, 1],
duration: 1000
});
Summary
Animate.css is a CSS-only animation library that offers pre-defined animations, making it easy to use for simple effects. It's lightweight and doesn't require JavaScript, but has limited customization options.
Anime is a JavaScript animation library that provides more control and flexibility. It supports complex animations, including SVG and object property animations. While it requires JavaScript and has a steeper learning curve, it offers better performance for intricate animations.
Choose Animate.css for quick, simple animations without JavaScript dependencies. Opt for Anime when you need more advanced, customizable animations and don't mind the JavaScript requirement.
A simple library to take care of complicated animations.
Pros of Choreographer-js
- Offers more granular control over animations with JavaScript
- Allows for complex, multi-step animations
- Provides a programmatic approach to creating animations
Cons of Choreographer-js
- Steeper learning curve compared to Animate.css
- Requires JavaScript knowledge and implementation
- Less suitable for quick, simple animations
Code Comparison
Animate.css (CSS):
.animate__animated.animate__bounce {
animation-name: bounce;
animation-duration: 1s;
}
Choreographer-js (JavaScript):
var choreographer = new Choreographer({
animations: [
{
range: [-1, 1],
selector: '#myElement',
type: 'scale',
style: 'transform:scale({{val}})'
}
]
});
Summary
Animate.css is a CSS-only library that provides pre-defined animations, making it easy to quickly add simple animations to elements. It's ideal for developers who want to implement animations with minimal effort.
Choreographer-js, on the other hand, is a JavaScript-based animation library that offers more flexibility and control over animations. It allows for complex, multi-step animations and is better suited for developers who need precise control over their animation sequences.
While Animate.css is more accessible for beginners and requires less setup, Choreographer-js provides a more powerful toolset for creating custom, intricate animations at the cost of a steeper learning curve and increased complexity.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Animate.css
If you need the old docs - v3.x.x and under - you can find it here.
Just-add-water CSS animation
Installation
Install with npm:
npm install animate.css --save
Install with yarn:
yarn add animate.css
Getting Started
You can find the Animate.css documentation on the website.
Accessibility
Animate.css supports the prefers-reduced-motion
media query so that users with motion sensitivity can opt out of animations. On supported platforms (currently all the majors browsers and OS), users can select "reduce motion" on their operating system preferences and it will turn off CSS transitions for them without any further work required.
Core Team
Daniel Eden | Elton Mesquita | Waren Gonzaga |
Animate.css Creator | Maintainer | Core Contributor |
License
Animate.css is licensed under the Hippocratic License.
Code of Conduct
This project and everyone participating in it is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to animate@eltonmesquita.com.
Contributing
Pull requests are the way to go here. We only have two rules for submitting a pull request: match the naming convention (camelCase, categorised [fades, bounces, etc]) and let us see a demo of submitted animations in a pen. That last one is important.
Top Related Projects
🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.
CSS3 Animations with special effects
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Tasty CSS-animated Hamburgers
JavaScript animation engine
A simple library to take care of complicated animations.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot