Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

aadarshantony/Ani-Js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

78 Commits

Repository files navigation

NPM Version NPM Downloads NPM Downloads

Ani-Js

A lightweight JavaScript animation library that mimics Tailwind-style utility classes β€” no Tailwind installation needed. Injects minimal CSS for clean animations like fadeIn, slideUp, and more.

  • πŸ“¦ No Tailwind required
  • πŸ’¨ Utility-class style like .tw-fade-in
  • ⚑ Zero setup, just import and use
  • 🧩 Works with plain JavaScript, React, Vue, TypeScript, and more
  • 🎨 100+ prebuilt animations and effects

πŸ“š Documentation & Playground

For full features, class names,playground, demos, and advanced usage, visit the official website:
πŸ‘‰ Ani-Js.com

⭐ If you find this package useful, please consider dropping a star on GitHub!


πŸš€ Installation

npm install ani-js

or

yarn add ani-js

πŸ”§ Usage

πŸ“œ Vanilla JavaScript

<div id="box">Hello</div>
<button id="btn">Animate</button>
<!-- for class based usage -->
<div id="box" class="tw-fade-in">Hello</div>
<script type="module">
 import { fadeIn } from 'ani-js';
 document.getElementById('btn').addEventListener('click', () => {
 const el = document.getElementById('box');
 fadeIn(el, 700);
 });
</script>

⚠️ Important:
This example uses ES Module syntax (import) and will not work by directly opening the HTML file in a browser.

To run this successfully, you must:

  • Use a module-aware bundler or dev server such as Vite , Webpack, or Parcel OR
  • Load ani-js from a CDN (like jsDelivr, UNPKG) that supports ES Modules
  • To use as classes in Html use stylesheets as jsDelivr
  • For React Import the package then in your App.jsx or Main.jsx import the classes from "../node_modules/ani-js/ani-js.css" set it as global so you can use it anywhere. Without one of these setups, your browser will throw a module resolution error and the animation will fail to load.
  • All the other use cases and informations are provided in the documentation!

βš›οΈ React

import { slideUp } from 'ani-js';
import { useEffect, useRef } from 'react';
function MyComponent() {
 return (
 //for class based usage
 <div className="tw-slide-up">
 Welcome!
 </div>
 );
}
function MyComponent() {
 const ref = useRef();
 useEffect(() => {
 slideUp(ref.current, 600);
 }, []);
 return <div ref={ref}>Welcome!</div>;
}

🀝 Contributing

🧭 Getting Started

  1. Fork the repository
  2. Clone your fork locally
    git clone https://github.com/Srinanth/Ani-Js.git
    cd ani-js
  3. Create a feature branch
    git checkout -b addition/new-animation
  4. Make changes – Add new animations, improve logic, or refactor existing code
  5. Commit your changes
    git commit -m "✨ Added New Animation"
  6. Push to your branch
    git push origin addition/new-animation
  7. Open a Pull Request on GitHub

πŸ“ Development Guidelines

  • Code Style: Follow existing patterns used in JavaScript, CSS, and React files
  • Animations: Keep utility class names consistent (tw-fade-in, tw-zoom-in, etc.)
  • Testing:
    • Manually test animations using the local playground page
    • Add unit tests where applicable (planned for future integration)
  • CSS: Avoid bloated styles β€” Ani-Js is meant to stay minimal and fast
  • Performance: Prefer CSS-based animations over JS unless JavaScript is required

πŸ§ͺ Local Dev Tips

  • Use the Vite dev server for rapid development
  • Run a local playground to test all animations in real-time

About

Ani-JS is a lightweight utility library that enhances Tailwind CSS with JavaScript-powered styling and interactive animations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • JavaScript 72.1%
  • CSS 27.7%
  • HTML 0.2%

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /