🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-loading-indicators

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-loading-indicators

Simply elegant light-weight loading indicators for react applications

0.1.0
Source
npm
Version published
Weekly downloads
7.1K
17.54%
Maintainers
1
Weekly downloads
 
Created
Source

react-loading-indicators

A light-weight library providing a collection of easy to use loading indicators for your React projects. Waiting for a response has to be fun🥳.

Built with Typescript. Compatible with react version >=16.8.0.

View DEMO.

Installation

npm install react-loading-indicators

or

yarn add react-loading-indicators

Components

<Atom />
<Commet />
<CircularProgress /> // Default import
<FourSquare />
<Mosaic />
<Riple />
<Seek />

Examples

Import an individual loader

import React from "react";
import { Atom } from "react-loading-indicators";

const Component = () => <Atom />;

export default Component;

OR Import default loader

import React from "react";
import Loader from "react-loading-indicators";

const Component = ({ variant, color, size }) => (
	<Loader variant={variant} color={color} size={size} />
);

export default Component;

Props

Each of these components will accept the following optional props.

NameDataTypeDefault ValuePossible Values
sizestringmediumsmall, medium, large
colorstring or arraylimegreenCSS color values
styleobjectnullCSS styles(in Reactjs format)
textstring or booleanfalseBoolean value or any string
textColorstringundefinedCSS color values

What do these props do?

  • size - Sets the size of the loader.
  • color - Sets the color of the loader.
  • style - Applies CSS styles to the loader
  • text - Displays message in the loader.
  • textColor - Sets the color of text message in the loader.

The CircularProgress component has a variant prop(also optional). Choose between variations of a circular loader that you want:

NameDataTypeDefault Valuevalues
variantstringdiscdisc, split-disc, dotted, bubble-dotted

How to resize

You can resize loader to fit into your needs with the size prop that accepts predefined string input.
You can further customize size to your own preferences by setting fontSize in the style prop of the loader. The style prop is an object that allows you to add your own css. Including fontSize in the style object will evenly alter size of the loader.

const Component = () => <Commet style={{ fontSize: "10px" }} />;

License

Distributed under the MIT License. See LICENSE for more information.

Contact

@smitterhane

Keywords

react

FAQs

Package last updated on 18 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts