Negligent Parachute Maintainers

npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

react-loading-animation

1.4.0 • Public • Published

React Loading Animation

A simple loading component to show a colorful animated spinner.

Usage

const Loading = require('react-loading-animation');

You can either render the component directly (with no props) or render it as a parent of other components and pass in isLoading as a prop:

const ListOfThings = ({ isFetching, things }) => {
    if (isFetching && things.size() == 0) return <Loading />;
    
    return (
        <ul>
            ...
        </ul>
    );
}

or

const ListOfThings = ({ isFetching, things }) => {
    return (
        <Loading isLoading={isFetching && things.size() == 0}>
            <ul>
                ...
            </ul>
        </Loading>
    );
}

Thanks

This component is based on the work at https://codepen.io/jczimm/pen/vEBpoL

install

npm i react-loading-animation

Downloadsweekly downloads

646

version

1.4.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability