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-randomizable

v1.0.6

Published

[![NPM](https://img.shields.io/npm/v/react-loading-randomizable)](https://www.npmjs.com/package/react-loading-randomizable) [![NPM](https://img.shields.io/badge/Watsize-Library-289548)](https://www.npmjs.com/package/react-loading-randomizable) [![Download

Downloads

73

Readme

react-loading-randomizable

NPM NPM Downloads

📘 About

A component for ReactJS which render overlay transparent screen, loading element and text label together as one.

Disclaimer: All of loading elements source code on this package are based on react-loadingg such as BabelLoading, BatteryLoading, and more.

⚙ Install

yarn add react-loading-randomizable
# or alternate npm way `npm install react-loading-randomizable`

📌 Example Usage

import { useState } from "react";
import { OverlayLoading } from "react-loading-randomizable";

const App = () => {
  const [loading, setLoading] = useState(true);

  const handleClick = () => {
    setLoading(true);
    setTimeout(() => {
      setLoading(false);
    }, 3000);
  };

  return (
    <>
      <OverlayLoading active={loading} />
      <button onClick={handleClick}>
        Click for show overlay loading for 3 seconds
      </button>
    </>
  );
}

export default App;

📋 Properties

| Property | Description | Type | Default | |-------------------|-------------------------------------------------------------|-----------------------|-------------| | active | to make loading overlay invisible, set it false | bool | true | | number | a specific index of loading element, see more a below table | number | -1 | | style | custom style of container element | React.CSSProperties | {} | | className | custom className of container element | string | "" | | text | text render alongside with loading element | React.ReactNode | "" | | textStyle | custom style of text element | React.CSSProperties | {} | | textClassName | custom className of text element | string | "" |

📝 Need More Example?

🙋 FAQ?

FAQ 1: What's the difference between this package and the original (react-loadingg)?

To inform you, I love the original package so much and appreciate them for creating such a useful package, but it has passed a long year since the last commit, so I want to resurrect it with an upgraded version of React, randomizable element on each render, and the overlay loading screen as the default.

FAQ 2: List of add-on features.

  1. Overlay screen (black screen with 70% transparency)
  2. Randomly render a loading element, but you can also be specific with your favorite one.
  3. Supported React 18.
  4. TypeScript on the new source code; leave JavaScript on the loading element (from the library) with no changes.

FAQ 3: I want to ask you more.

Please feel free to create an issue on GitHub. I would love to answer all of the questions, and I am also welcome for all the PR. ❤️

𝌡 Changelog

Please see more CHANGELOG.md

⚒ Thanks a lot