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

reveal-animation-react

v1.0.0

Published

A React component with smooth reveal animation on scroll using Intersection Observer

Downloads

11

Readme

npm version License React TypeScript Bundle Size


🎯 Overview

A lightweight, high-performance React component that triggers beautiful CSS animations when elements scroll into view. Perfect for creating engaging landing pages, portfolios, and interactive user experiences.

Built with TypeScript, zero external dependencies (except React), and optimized for production use.


✨ Features

| Feature | Benefit | |---------|---------| | 🚀 High Performance | CSS-based animations that never block the main thread | | 🎨 Easy to Use | Wrap any content to add reveal effects instantly | | ⚙️ Highly Customizable | Control width, delay, and animation styles | | 📘 TypeScript Support | Fully typed with excellent IDE support | | 📦 Lightweight | ~8.7 KB (gzipped: ~3.2 KB) with no heavy dependencies | | ♿ Accessible | Uses modern Intersection Observer API | | 🔄 Framework Agnostic CSS | Customize animations with standard CSS | | 🌍 Universal Browser Support | Works on all modern browsers |


📦 Installation

Choose your favorite package manager:

# npm
npm install @firat/reveal-animation

# yarn
yarn add @firat/reveal-animation

# pnpm
pnpm add @firat/reveal-animation

# bun
bun add @firat/reveal-animation

🚀 Quick Start

Basic Usage

import { Reveal } from '@firat/reveal-animation';

function App() {
  return (
    <Reveal>
      <h1>This content will be revealed with a smooth animation!</h1>
    </Reveal>
  );
}

With Custom Props

import { Reveal } from '@firat/reveal-animation';

function App() {
  return (
    <div>
      <Reveal width="100%">
        <section className="hero">
          <h2>Full Width Animation</h2>
        </section>
      </Reveal>

      <Reveal delay={200}>
        <p>This animates with a 200ms delay</p>
      </Reveal>

      <Reveal width="fit-content" delay={400}>
        <button>Click Me!</button>
      </Reveal>
    </div>
  );
}

📋 Props API

| Prop | Type | Default | Description | |:-----|:-----|:--------|:------------| | children | ReactNode | Required | Content to be revealed with animation | | width | "fit-content" \| "100%" | "fit-content" | Width of the wrapper element | | delay | number | 0 | Animation delay in milliseconds |

Example with All Props

<Reveal width="100%" delay={300}>
  <div>Custom styled content</div>
</Reveal>

🎨 Animation Customization

Default Animation

The component comes with a smooth fade-in and slide-up animation:

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

Custom Animations

Override the default styles in your CSS:

/* Fade in from left */
.reveal {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Zoom in animation */
.reveal {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.5s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: scale(1);
}

/* Rotate and fade */
.reveal {
  opacity: 0;
  transform: rotateY(90deg);
  transition: all 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: rotateY(0deg);
}

🌐 Browser Support

  • ✅ Chrome 51+
  • ✅ Firefox 55+
  • ✅ Safari 12+
  • ✅ Edge 16+
  • ✅ Mobile browsers (iOS Safari 12.2+, Chrome Mobile)

Requires:

  • React 16.8+ (Hooks support)
  • ES2015+ support
  • Intersection Observer API support

📚 Advanced Examples

Multiple Staggered Animations

function StaggeredList() {
  return (
    <ul>
      {['Item 1', 'Item 2', 'Item 3', 'Item 4'].map((item, index) => (
        <li key={item}>
          <Reveal delay={index * 100}>
            {item}
          </Reveal>
        </li>
      ))}
    </ul>
  );
}

Responsive Layout

function ResponsiveSection() {
  const isMobile = window.innerWidth < 768;
  
  return (
    <Reveal width={isMobile ? "100%" : "fit-content"}>
      <div className="responsive-content">
        <h2>Responsive Content</h2>
      </div>
    </Reveal>
  );
}

🛠️ Development

Clone and set up the project:

git clone https://github.com/yourusername/reveal-animation.git
cd reveal-animation
bun install
bun run dev

Available Scripts

# Development server with HMR
bun run dev

# Build for production
bun run build

# Run linting
bun run lint

# Preview production build
bun run preview

📄 License

MIT © 2026 - See LICENSE file


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

How to Contribute

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📞 Support