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 to have a glimpse.
Installation
npm i react-loading-indicators
or
yarn add react-loading-indicators
Components
<Atom>
<Commet>
<CircularProgress>
<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.
size | string | medium | small, medium, large |
color | string or array | limegreen | CSS color values |
style | object | null | CSS styles |
text | string or boolean | false | Boolean value or any string |
textColor | string | undefined | CSS 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 an additional variant
prop(also optional). Choose between variations of a circular loader that you want:
variant | string | disc | disc, split-disc, dotted, bubble-dotted |
How to resize
You can resize loader to fit into your needs with the size
prop that accepts predefined strings.
You can customize the size further to your preferences by setting fontSize
in the style prop of the loader. The style prop allows you to add your own css.
const Component = () => <Commet style={{ fontSize: "10px" }} />;
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
@smitterhane