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

react-loading-retry-overlay

v1.2.0

Published

An overlay showing a loading indicator and retry button according to props

Downloads

10

Readme

react-loading-retry-overlay

The last loading indicator you'll ever need

NPM

What is this?

A loading overlay to cover a widget while it loads data. You may use several of them at the same time independently. Try the demo at Github.

Features

  • Support for Chrome, Firefox, Edge & even Internet Explorer 11
  • A translucent overlay with a spinner, invisible when everything is loaded
  • An error alert for when something goes wrong
  • A configurable retry button with a timer, for when retrying makes sense
  • Customizable background, icons and button colors via passing CSS class names
  • Bundled original SVG icons

Install

npm install --save react-loading-retry-overlay

Usage

import React, { Component } from 'react'

import LoadOverlay from 'react-loading-retry-overlay'

class Example extends Component {
  render () {
    return (
      <LoadOverlay loading>
        your jsx here
      </LoadOverlay>
    )
  }
}

Props

  • loading: if true, the overlay and spinner will be shown
  • error: if true and not loading, the overlay and alert icon will be shown
  • retryEnabled: if true and the onRetry prop is also passed, the retry button will be shown
  • onRetry: a function with no parameters that will be called when the retry button is clicked
  • timeout: the number (string or otherwise) of seconds to countdown before retrying.
  • manualRetry: if true, retry only happens when the button is clicked
  • spinnerIcon: pass your own jsx here to be used as a spinner
  • alertIcon: pass your own jsx here to be used as an alert icon
  • retryText: pass your own text to replace the contents of the retry button
  • colorClass: set color and background-color in a CSS class and pass the class name here to be used only in the overlay.
  • errorColorClass: set color in a CSS class and pass the name here to be used only inthe alert icon and retry button.
  • className: you may pass an additional className to be used on top of everything.
  • silent: if true, failures will not be shown while retries are enabled. Timeout will be respected.

Caveats

  • Automatic retry doesn't work in IE11. No countdown animation either.
  • icons and button sizes are fixed, because IE11 likes it that way.
  • retryText is overlaid on top of the button, so the button is a fixed size (in rems)
  • There's no error message UI. This is meant to be used independently in every widget, where there's usually no space, but you could replace the alert icon with a message.
  • No handling of actual requests, it's UI only.

License

MIT © IndianaGeorge