animate.css as a Tailwind plugin

Overview

tailwind-animatecss

Use animate.css as a Tailwind 3 plugin.

Demo – https://dumptyd.github.io/tailwind-animatecss

Table of contents

Installation

yarn add tailwind-animatecss animate.css
# OR
npm install tailwind-animatecss animate.css

Specify the plugin in tailwind.config.js

module.exports = {
  // ...
  plugins: [
    require('tailwind-animatecss')
  ],
  // ...
};

Usage

Animations can be applied using animatecss prefixed classes:

<h1 class="animatecss animatecss-bounce">Bouncy!</h1>
<h1 class="animatecss animatecss-slideInDown">Sliding in</h1>
<h1 class="animatecss animatecss-jackInTheBox">Jack in the box</h1>

All animate.css classes are modified to use the animatecss class name and prefix to avoid conflicts with Tailwind's animations. The table below should give you an idea of how the classes are mapped to the prefix.

animate.css tailwind-animatecss
animate__animated animatecss
animate__fadeIn animatecss-fadeIn
animate__infinite animatecss-infinite
animate__repeat-2 animatecss-repeat-2
animate__delay-2s animatecss-delay-2s
animate__fast animatecss-fast
... and so on

Advanced

Changing the prefix

By default, animatecss is used as the base class name and prefix for classes. This can be changed by specifying the theme.animatecss.prefix option in tailwind.config.js.

module.exports = {
  // ...
  theme: {
    animatecss: {
      prefix: 'custom-animation'
    }
  }
  // ...
};
// class names will now be available under
// `custom-animation`, `custom-animation-bounce`, `custom-animation-infinite` and so on.

How this plugin differs from other implementations

Unlike other projects, this plugin doesn't implement the animations through a rewrite of the animate.css utilities.

Instead, classes, keyframes and styles are read from your installed version of animate.css at compile time and these are registered with Tailwind so the animations can be used with purging support, IntelliSense and other Tailwind goodness.

Contributing

https://github.com/dumptyd/tailwind-animatecss/issues

License

MIT

You might also like...

Javascript library to animate images on hover.

Ripple Hover Effect Javascript library to animate images on hover. If this project help you, don't forget to star it. Codepen demo by Essam Abed Demo

Nov 21, 2022

Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more human likely.

Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more human likely.

Write and Delete Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more

Nov 15, 2022

The easiest way to animate your Next.js project. Scrollreveal.js helper package.

next-reveal The easiest way to animate your Next.js app Demo Introduction next-reveal makes it easy to add awesome scroll animations to your Next.js p

Nov 25, 2022

Alpine.js wrapper for @formkit/auto-animate.

πŸ’« Alpine AutoAnimate πŸ’« An Alpine.js wrapper for @formkit/auto-animate. πŸš€ Installation CDN Include the following script tag in the head of your

Dec 28, 2022

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

Crowdcoin ♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS. Project from "Ethereum and Solidity: T

Dec 14, 2022

Personal developer portfolio written with NextJS and Tailwind CSS.

Developer Portfolio This is a Next.js, Tailwind CSS blogging starter template. Probably the most feature rich nextjs markdown blogging template out th

Dec 20, 2021

The 2048 game built with Angular & Tailwind CSS

Ng2048 This project was generated with Angular CLI version 13.1.2. Development server Run ng serve for a dev server. Navigate to http://localhost:4200

Mar 10, 2022

πŸš€ A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

πŸš€ A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

Web Extension Starter A web extension starter, built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome

Dec 28, 2022

Explore movies, tv shows. Built with Next.js, Tailwind CSS, Redux, Firebase, TypeScript, TMDB v3 API.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Dec 4, 2022
Comments
  • Does not work with Nextjs

    Does not work with Nextjs

    When trying to use this module on a Nextjs application it fails with the following error:

    error - ./node_modules/.pnpm/[email protected]_09fd6390c35d3a8fd7ec9f7f97366738/node_modules/tailwind-animatecss/plugin.js:2:0
    Module not found: Can't resolve 'fs'
    
    Import trace for requested module:
    ./tailwind.config.js
    ./helpers/css.js
    ./components/fullImageSection.jsx
    ./pages/index.js
    
    https://nextjs.org/docs/messages/module-not-found
    Native Node.js APIs are not supported in the Edge Runtime. Found `fs` imported.
    
    opened by Aex12 0
βͺ Rewinds – Remix Tailwind Starter Kit with Tailwind CSS, Headless UI, Radix UI, and more

βͺ Rewinds – Remix Tailwind Starter Kit Rewinds is a Remix starter kit with Tailwind CSS v3 family of libraries. This is an example demo to combine the

M Haidar Hanif 81 Dec 24, 2022
A Tailwind plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and all variations.

Tailwind Labeled Groups A plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and

Max 18 Nov 21, 2022
A JQuery plugin to animate text as in the credits of the 2014 movie "Birdman".

birdman.js A JQuery plugin to animate text as in the credits of the 2014 movie "Birdman". See it in action at chrisma.github.io/birdman.js I'm aware t

Christoph Matthies 33 Dec 30, 2021
Animate on scroll library

❗ ❗ ❗ This is README for aos@next ❗ ❗ ❗ For last stable release (v2) go here ?? Demo ?? Codepen Examples Different built-in animations With anchor set

MichaΕ‚ SajnΓ³g 22.3k Jan 2, 2023
An easy way to animate SVG elements.

Walkway I loved the animations for the polygon ps4 review a few months back and decided to create a small library to re-create them (simple demo). It

Connor Atherton 4.4k Jan 2, 2023
Animate your Alpine components.

Animate your Alpine components ?? This package provides you with a simple helper to animate your ALpine.js components. Installation The recommended wa

Ralph J. Smit 18 Nov 16, 2022
Quick and easy spring animation. Works with other animation libraries (gsap, animejs, framer motion, motion one, @okikio/animate, etc...) or the Web Animation API (WAAPI).

spring-easing NPM | Github | Docs | Licence Quick and easy spring animations. Works with other animation libraries (gsap, animejs, @okikio/animate, mo

Okiki Ojo 34 Dec 14, 2022
Animate elements as they scroll into view.

Animate elements as they scroll into view. Introduction ScrollReveal is a JavaScript library for easily animating elements as they enter/leave the vie

null 21.2k Jan 4, 2023
A lightweight script to animate scrolling to anchor links.

DEPRECATION NOTICE: Smooth Scroll is, without a doubt, my most popular and widely used plugin. But in the time since I created it, a CSS-only method f

Chris Ferdinandi 5.4k Dec 26, 2022
A javascript library to animate elements on scroll page events

ScrollJS by Sam Sirianni ScrollJS is a library written in Javascript. With ScrollJS you can animate elements on scroll events. Visit the ScrollJS webs

Sam Sirianni 1 Mar 21, 2021