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-loadscreen-ui

v0.1.2

Published

`react-load-ui` is a customizable React component for creating engaging loading screens. It provides a seamless way to display load screens with various styles, making it easy to enhance the user experience in your React applications.

Downloads

9

Readme

react-loadscreen-ui (package)

react-load-ui is a customizable React component for creating engaging loading screens. It provides a seamless way to display load screens with various styles, making it easy to enhance the user experience in your React applications.

Table of contents

Installation

To install the package, use npm


  npm install react-loadscreen-ui

visit the website for any issue - https://www.npmjs.com/package/react-loadscreen-ui

Usage

Import the 'LoadingProvider' and wrap it arround the entire application. So that the loadscreen can be used and called anywhere in the application.


import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App.jsx'

// package imports for react-loadscreen-ui
import { LoadingProvider, LoadingScreen } from 'react-loadscreen-ui'
import "react-loadscreen-ui/dist/style.css"

createRoot(document.getElementById('root')).render(
  <StrictMode>
    <LoadingProvider>
      <LoadingScreen
        text="Please wait ..."
        spinnerSize={30}
        backgroundColor='rgba(40, 44, 52, 0.7)'
        textColor="#61dafb"
      />
      <App />
    </LoadingProvider>
  </StrictMode>,
)

After that you can inport the useLoading context for controlls over the loadscreen.


import { useEffect } from 'react'
import './App.css'
//package import for laodscreen context.
import { useLoading } from 'react-loadscreen-ui';

export default function App() {

  // function to controll the loadscreen (hide / show)
  const { showLoadScreen, hideLoadScreen } = useLoading();

  useEffect(() => {
    showLoadScreen();     // for showing the loadscreen ui
    setTimeout(() => {
      hideLoadScreen();   // for hiding the loadscreen ui
    }, 5000);
  }, []);

  return (
    <>
      <p className="read-the-docs">
      This is a demo page for testing the loadscreen ui.
      {/* Rest of your content */}
      </p>
    </>
  )
}

Features

The ui package is responsible for displaying the laoding screen as pre required, it has context that controls the state of the loading screen. The contextProvider, provides the state isLoading, showLoading() and hideLoading().

Currently the package comprises for one screen

  • {LoadingScreen} (loading screen with props for customization)

The LoadScreen component accept the following props :

| Prop | Type | Default | Description | | ----- | ---- | ------- | ----------- | | text | string | Loading... | The message displayed on the loading screen | | spinner | boolean | true | Whether to display a spinner | | spinnerSize | number | 50 | The size of the spinner in pixels | | backgroundColor | string | rgba(0, 0, 0, 0.5) | The background color of the loading screen | | textColor | string | #fff | The color of the loading text |

Project-Structure

react-loadscreen-ui/
│
├── lib/                      # Contains all the package files
│   ├── LoadingScreen/        # Components and style files
│   |   ├── index/            # Exports the resources
│   |   ├── LoadingContext/   # Context for loadingScreen
│   |   ├── LoadingScreen/    # UI components
│   |   └── styles/           # UI styling
│   └── main                  # main file (entry point)
├── public/                   # Public files
├── src/                      # Source files for testing
│   ├── App/                  # App page
│   ├── main/                 # Main application page
│   ├── assets/               # Images, icons, etc.
│   └── ...                   # Other directories or files
├── package.json              # Node.js dependencies and scripts
├── README.md                 # The file you're reading
└── ...                       # Any other essential files

Contact

email - [email protected] linkedIn - https://www.linkedin.com/in/abhishek-oraon-developer/