tw-animate-css
Tailwind CSS v4.0 compatible animation plugin replacement.
3. Used by agents' projects
Dependency in 567 public GitHub projects set up for AI coding agents that we scanned (9.1%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What tw-animate-css does
tw-animate-css rebuilds the animate-in/animate-out class vocabulary of tailwindcss-animate as a single plain CSS file for Tailwind CSS v4, added with one @import line instead of a JavaScript plugin.
tw-animate-css popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How tw-animate-css is used
- tw-animate-css is a dependency in 567 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (11.6% of the 4,867 JavaScript/TypeScript ones), #1 of 46 in animation and motion.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,859; those are left out of every share on this page.
- The most used alternative in our scan is Tailwind CSS Animate (424 projects).
- Projects that use it most often also use clsx (96.1%), Tailwind Merge (95.8%), Class Variance Authority (93.1%).
By coding agent
Often used with
tw-animate-css in practice
Strengths
Setup is a single <code>@import "tw-animate-css";</code> line in your main stylesheet. The README says it follows Tailwind v4's CSS-first architecture instead of the legacy JavaScript plugin system.
An entrance or exit is a base class (<code>animate-in</code> or <code>animate-out</code>) plus one or more effects. Fade, zoom, spin, slide and blur are the available effects. The README's own setup example builds a fade-and-zoom entrance and a slide-to-top-left exit this way.
Effects take values, not only fixed presets. For blur, the README lists <code>blur-in</code>, <code>blur-in-<number></code>, <code>blur-in-(<custom-property>)</code> and <code>blur-in-[<value>]</code>.
The README says ready-made animations you never use, such as <code>accordion-down</code>, are left out of the final CSS. It credits Tailwind's own tree-shaking for this.
Watch out for
The author writes that they use only a small portion of the original plugin. As a result, it "might not be a 100% compatible drop-in replacement."
The README warns that the next major release includes breaking changes. It promises a migration script and a guide.
v1.4.0 moved support for Tailwind's prefix option to a separate <code>tw-animate-css/prefix</code> import, so projects that use a prefix must change their import. The author presents this as reverting the previous version's change, because more people use spacing than prefixes. The author says they do not plan breaks like this in non-major releases.
Enter and exit driven by a data attribute
<div
class="data-[state=show]:animate-in data-[state=hide]:animate-out fade-in slide-in-from-top-8 fade-out slide-out-to-top-8 duration-500"
data-state="show"
>
<p>
If the element has the <code>data-state="show"</code> attribute,<br />
fade in from 0% opacity,<br />
slide from top by 8 spacing units (2rem),<br />
with a 500ms duration.
</p>
<p>
If the element has the <code>data-state="hide"</code> attribute,<br />
fade out to 0% opacity,<br />
slide to top by 8 spacing units (2rem),<br />
with a 500ms duration.
</p>
</div>More about tw-animate-css
Funding
- GitHub Sponsors: https://github.com/Wombosvideo
Head to head
- tw-animate-css vs Tailwind CSS Animate used together in 65 projects
Packages around it
- clsx: Conditional class strings
- tailwind-merge: Merge conflicting Tailwind classes
- class-variance-authority: Component class variants
- lucide-react: Icon components
- tailwindcss: Utility-first CSS framework
- react: UI library
Alternatives
tw-animate-css This page
Tailwind CSS plugin adding ready-to-use animation utilities.
Animation library for JavaScript and React with simple, powerful motion primitives.
Get started
Install it.
npm install tw-animate-cssRules for your agent
## tw-animate-css
- Install with `npm install -D tw-animate-css` and add `@import "tw-animate-css";` to `app.css` or `globals.css`.
- When migrating from `tailwindcss-animate`, remove it from dependencies, remove `@plugin 'tailwindcss-animate'` from `globals.css`, install tw-animate-css as a dev dependency, and add the import above.
- Apply `animate-in` or `animate-out` alongside effect classes like `fade-in`, `zoom-in` or `slide-in-from-top-8`. The README says this base class "needs to be applied in order for enter/exit animations to work."
- Set timing with `duration-*`, `delay-*`, `ease-*`, `repeat-*`, `direction-*` and `fill-mode-*`. Duration defaults to `duration-150`.
- If the project uses Tailwind's prefix option, import `tw-animate-css/prefix` instead of `tw-animate-css` (since v1.4.0).
- `accordion-*` and `collapsible-*` need `--radix-accordion-content-height` / `--radix-collapsible-content-height` (or another listed content height variable) set to the content's height.
- Do not assume full parity with `tailwindcss-animate`. Check classes you port over.