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

@dipakshiroya/react-progressive-image

v0.1.7

Published

A React component for progressive image loading with placeholders, lazy load, aspect ratio and fallback support.

Readme

@dipakshiroya/react-progressive-image

npm version license React

A lightweight, flexible React component for progressive image loading — featuring blurred placeholders, lazy loading, aspect ratio support, and fallbacks.
No more manual hacks for skeletons or blurred thumbnails.


✨ Features

  • 🖼️ Progressive loading (blurred low-res placeholder)
  • 💤 Lazy loading via native loading="lazy"
  • 🧩 Maintains aspect ratio to prevent layout shifts
  • 🚨 Fallback image if load fails
  • 🎨 Smooth fade-in transition
  • ⚙️ Fully typed with TypeScript
  • 🪶 Zero dependencies

📦 Installation

npm install @dipakshiroya/react-progressive-image
# or
yarn add @dipakshiroya/react-progressive-image
# or
pnpm add @dipakshiroya/react-progressive-image

Note: use --force if you face any issues

🚀 Usage

Basic Example

import React from "react";
import ProgressiveImage from "@dipakshiroya/react-progressive-image";

export default function App() {
  return (
    <div style={{ maxWidth: 600, margin: "0 auto" }}>
      <h1>Progressive Image Example</h1>

      <ProgressiveImage
        src="https://picsum.photos/id/1015/800/500"           // Full-res image
        placeholderSrc="https://picsum.photos/id/1015/80/50"  // Blurred low-res preview
        fallbackSrc="https://via.placeholder.com/800x500"     // Fallback if src fails
        aspectRatio={800 / 500}                               // Maintain aspect ratio
        alt="Mountain landscape"
        className="rounded-lg shadow-lg"
      />
    </div>
  );
}

📐 Props

| Prop | Type | Description | Default | |------|------|-------------|----------| | src | string | High-resolution image URL | required | | placeholderSrc | string | Low-resolution / blurred preview | undefined | | fallbackSrc | string | Backup image if main fails | undefined | | aspectRatio | number | Keeps layout consistent before load | undefined | | className | string | Extra CSS class names | "" | | style | React.CSSProperties | Inline styles for wrapper | {} | | ...imgProps | React.ImgHTMLAttributes<HTMLImageElement> | Any native <img> props | — |


⚡ Advanced Example

Image Grid with Automatic Blurred Previews

const images = [1011, 1012, 1013];

export const Gallery = () => (
  <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
    {images.map(id => (
      <ProgressiveImage
        key={id}
        src={`https://picsum.photos/id/${id}/400/300`}
        placeholderSrc={`https://picsum.photos/id/${id}/40/30`}
        aspectRatio={4 / 3}
        alt={`Image ${id}`}
      />
    ))}
  </div>
);

💡 Tips

  • Generate low-res placeholders using Picsum, ImageKit, or Cloudinary.
  • Fully compatible with Tailwind, MUI, Chakra, etc.
  • Works with SSR (Next.js) and CSR (Vite, CRA) environments.

🧱 TypeScript Support

Type definitions are built-in.
You can import props directly:

import ProgressiveImage, { ProgressiveImageProps } from "@dipakshiroya/react-progressive-image";

🧩 Compatible With


🛠️ Development

If contributing or testing locally:

git clone https://github.com/dipakshiroya/react-progressive-image
cd react-progressive-image
npm install
npm run build
npm link

Then in another project:

npm link @dipakshiroya/react-progressive-image

🪪 License

MIT © Dipak Shiroya


🌟 Support

If you like this package, please ⭐ it on GitHub!
Feedback and contributions are always welcome.