npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-fade-in-view

v1.2.8

Published

Lightweight fade-in animation component using Intersection Observer

Readme

react-fade-in-view

react-fade-in-view is a lightweight React fade-in animation library that triggers smooth scroll-based animations when elements enter the viewport using the Intersection Observer API.

Ideal for React & Next.js applications, landing pages, portfolios, blogs, and content-heavy websites that need performant viewport animations.


✨ Features

  • Lightweight: No extra animation libraries
  • Intersection Observer: Animates elements on viewport enter
  • Simple API: Easy to use, fully customizable
  • Directional animations: Up, down, left, right, fade, zoom
  • Optional repeat: Animate every time or just once
  • React & Next.js compatible
  • TypeScript ready

📦 Installation

npm install react-fade-in-view

or

yarn add react-fade-in-view

🚀 Basic Usage

import { FadeIn } from "react-fade-in-view";
import "react-fade-in-view/dist/index.css";

export default function FadeInWithChildElement() {
  return (
    <FadeIn direction="up">
      <h1>Hello World</h1>
    </FadeIn>
  );
}

export default function FadeInAsHTMLTag() {
  return (
    <FadeIn as="h1" direction="up">
      Hello World
    </FadeIn>
  );
}

🧭 Animation Directions

<FadeIn direction="left">Left Fade</FadeIn>
<FadeIn direction="right">Right Fade</FadeIn>
<FadeIn direction="up">Up Fade</FadeIn>
<FadeIn direction="down">Down Fade</FadeIn>
<FadeIn direction="fade">Fade Only</FadeIn>
<FadeIn direction="zoom">Zoom In</FadeIn>

⚙️ Props

| Prop | Type | Default | Description | | ----------- | --------------------------------------------------------- | ------- | --------------------------------------------------- | | as | React.ElementType | div | Element or component to render instead of div | | direction | "up" \| "down" \| "left" \| "right" \| "fade" \| "zoom" | up | Animation style / direction | | className | string | "" | Optional custom CSS classes | | immediate | boolean | false | Animate immediately instead of waiting for viewport | | children | React.ReactNode | — | Content to animate | | ...rest | any | — | Pass extra props to the rendered element |


🕒 Custom Duration & Delay

<FadeIn as="p" duration={800} delay={200}>
  This fades in slowly with a delay
</FadeIn>

🔁 Repeat Animation on Scroll

<FadeIn as="p" once={false}>
  This will animate every time it enters the viewport
</FadeIn>

🔗 Next.js Usage Example

import { FadeIn } from "react-fade-in-view";
import "react-fade-in-view/dist/index.css";

export default function Page() {
  return (
    <main>
      <FadeIn direction="up">
        <h1>Next.js Page with FadeIn</h1>
      </FadeIn>
    </main>
  );
}

🤔 Why react-fade-in-view?

  • Better performance than animation-heavy libraries
  • Zero runtime dependencies
  • Ideal replacement for simple Framer Motion use-cases
  • Works perfectly with SSR & Next.js

🔎 Keywords

React fade animation, fade in on scroll React, Intersection Observer React animation, Next.js scroll animation, lightweight React animation library


☕ Buy Me a Coffee

Love using react-fade-in-view?
Support the project by buying me a coffee ☕ and helping future development.

UPI ID: ayushpatel5659-1@okhdfcbank


📄 License

MIT © Aayush Daboriya