Coder Social home page Coder Social logo

marcos-montero / aos-react-tailwind Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 18 KB

The easiest way to animate your Tailwind React Components on scroll. Add life to your web app with simple yet powerful animations.

Home Page: https://aos-react-tailwind-example.marcosmontero.dev/

License: MIT License

TypeScript 100.00%
animate animate-on-scroll aos react reactjs scroll tailwind tailwindcss

aos-react-tailwind's Introduction

Animate On Scroll (AOS) for TailwindCSS + React 🎨📜

The easiest way to animate your Tailwind React Components on scroll. Add life to your web app with simple yet powerful animations.

Final Conversion

🚀 Getting Started

To use AOS for TailwindCSS + React, install the package via npm:

npm install aos-react-tailwind

📖 Basic Usage

First, import the Aos component from the package:

import Aos from "aos-react-tailwind";

Then, wrap any component you want to animate inside Aos and define the className prop as a function that returns the TailwindCSS classes:

(...)
      <Aos
        className={(inView) => [
          "opacity-0 duration-500",
          inView && "opacity-1",
        ]}
      >
        <DogCard dog={dog} />
      </Aos>
(...)

⚙️ Props

Aos accepts all props that react-intersection-observer does, along with the following:

  • className: A function that receives inView (a boolean indicating if the element is in the viewport) and returns the class names to be applied.

🤝 Peer Dependencies

Make sure to have TailwindCSS set up in your project, as this package is designed to be used in conjunction with it.

🔧 Contributing

If you have suggestions for how AOS for TailwindCSS + React could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

📄 License

AOS for TailwindCSS + React is MIT licensed.

💡 Inspired By

This project is inspired by AOS - Animate on scroll library .

✨ Show Your Support

Give a ⭐️ if this project helped you!

aos-react-tailwind's People

Contributors

marcos-montero avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.