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 🙏

© 2024 – Pkg Stats / Ryan Hefner

progressify-react

v0.1.16

Published

A React library for progressive images using Sizeable

Downloads

16

Readme

Progressify React

Progressify React is a powerful React library for implementing progressive image loading using Sizeable. It provides easy-to-use components to enhance the image loading experience in your React applications.

Features

  • Progressive image loading
  • Lazy loading support
  • Thumbnail support
  • Easy integration with React applications
  • Customizable placeholder and image styles

Installation

Install Progressify React using npm or yarn:

npm install progressify-react
# or
yarn add progressify-react

Usage

Process Your Images

Use Sizeable To generate your images folder and index.json, which are REQUIRED to use progressify-react

Copy the contents of the generated zip to your apps public folder

ImageProvider

Wrap your application with the ImageProvider to provide the image context to your components:

import React from "react";
import { ImageProvider } from "progressify-react";
import App from "./App";

const Main = () => (
  <ImageProvider>
    <App />
  </ImageProvider>
);

export default Main;

ProgressiveImage

Use the ProgressiveImage component to display progressive images:

import React from "react";
import { ProgressiveImage } from "progressify-react";

const YourComponent = () => (
  <ProgressiveImage
    src="image-name"
    placeholderClassName="blur-lg"
    className="any-old-class"
    alt="Description of the image"
    thumb
    lazy
  />
);

export default YourComponent;

API Reference

ProgressiveImage

The ProgressiveImage component accepts the following props:

| Prop | Type | Default | Description | | ---------------------- | ------- | ---------- | ------------------------------------------------------------------------ | | src | string | (required) | The source name of the image (as defined in your Sizeable configuration) | | className | string | '' | CSS class name for the image element | | placeholderClassName | string | '' | CSS class name for the placeholder element | | alt | string | '' | Alternative text for the image | | thumb | boolean | false | Whether to use the thumbnail version of the image | | lazy | boolean | false | Whether to enable lazy loading for the image |

Usage Tips

  • Use the thumb prop for smaller images or in list views to improve initial load times.
  • Enable lazy loading for images that are not immediately visible on page load.
  • Provide meaningful alt text for all images to improve accessibility.

Contributing

We welcome contributions to Progressify React! Please see our Contributing Guide for more details.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

If you encounter any issues or have questions, please file an issue on our GitHub repository.