1.0.5 • Published 2 months ago

react-ui-loaders v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

React UI Loaders

A collection of customizable loading animations for React applications.

Installation

Using npm:

npm install react-ui-loaders

Using yarn:

yarn add react-ui-loaders

Available Loaders

  1. CircleLoader
  2. PulseLoader
  3. SpinnerLoader
  4. DotLoader
  5. RingLoader
  6. WaveLoader
  7. BounceLoader
  8. SquareLoader
  9. HeartbeatLoader
  10. OrbitLoader
  11. GlowLoader
  12. FullScreenLoader

Usage

Basic Loaders

Import the desired loader component and use it in your React component:

  1. Import the loader
import {
    CircleLoader,
    PulseLoader,
    SpinnerLoader,
    DotLoader,
	RingLoader,
    WaveLoader,
    BounceLoader,
    SquareLoader
    HeartbeatLoader,
    OrbitLoader,
    GlowLoader
} from "react-ui-loaders";
  1. Add the loader to your JSX

CircleLoader

<CircleLoader size={80} color="#cba6f7" thickness={4} speed={1} />

PulseLoader

<PulseLoader size={80} color="#cba6f7" />

SpinnerLoader

<SpinnerLoader size={80} color="#cba6f7" />

DotLoader

<DotLoader size={80} color="#cba6f7" />

RingLoader

<RingLoader size={80} color="#cba6f7" />

WaveLoader

<WaveLoader size={80} color="#cba6f7" />

BounceLoader

<BounceLoader size={80} color="#cba6f7" />

SquareLoader

<SquareLoader size={80} color="#cba6f7" />

HeartbeatLoader

<HeartbeatLoader size={80} color="#cba6f7" />

OrbitLoader

<OrbitLoader size={80} color="#cba6f7" />

GlowLoader

<GlowLoader size={80} color="#cba6f7" />
  1. Customize with props as needed

FullScreenLoader

The FullScreenLoader component creates a full-screen overlay with the selected loader centered on the screen:

  1. Import the FullScreenLoader
import { FullScreenLoader } from "react-ui-loaders";
  1. Use state to control the loader's visibility
  2. Add the FullScreenLoader to your JSX, conditionally rendered based on the loading state
function MyComponent() {
    const [isLoading, setIsLoading] = useState(false);
    return (
        <div>
            {isLoading && (
                <FullScreenLoader
                    loaderType="spinner"
                    size={80}
                    color="#ffffff"
                    backgroundColor="rgba(0, 0, 0, 0.7)"
                    isLoading={isLoading}
                />
            )}
            <button onClick={() => setIsLoading(!isLoading)}>
                Toggle Loader
            </button>
        </div>
    );
}
  1. Customize with props as needed

API

CircleLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader
thicknessnumber4Thickness of the circle
speednumber1Animation speed (1 is normal, 2 is twice as fast)

PulseLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

SpinnerLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

DotLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

RingLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

WaveLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

BounceLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

SquareLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

HeartbeatLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

OrbitLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

GlowLoader

PropTypeDefaultDescription
sizenumber40Size of the loader in pixels
colorstring'#61dafb'Color of the loader

FullScreenLoader

PropTypeDefaultDescription
loaderTypestring'circle'Type of loader to display ('circle', 'pulse', 'spinner', 'dot')
sizenumber60Size of the loader in pixels
colorstring'#61dafb'Color of the loader
thicknessnumber-Thickness of the loader (for applicable types)
speednumber-Animation speed (for applicable types)
backgroundColorstring'rgba(0, 0, 0, 0.5)'Background color of the full-screen overlay
isLoadingbooleantrueWhether to display the loader

License

ISC License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1.0.5

2 months ago

1.0.4

2 months ago

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago