1.0.8 • Published 5 years ago

react-loading-animate v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-loading-animate

A simple animate for loading with React component.

In this React library, All of animate style and design create by this pen, thank Manoz!

Installation

Install from npm:

npm install react-loading-animate --save

Import in your project:

import Loading from 'react-loading-animate';
// Be sure to include styles at during use react-loading-animate.
import 'react-loading-animate/dist/main.css';

Usage

react-loading-animate is easy to generate animate for loading with React component.

Basic Usage

Code

import React, { useState } from 'react';
import Loading from 'react-loading-animate';
import 'react-loading-animate/dist/main.css';

const App = () => {
  const [isLoading, setIsLading] = useState(false);
  const loading = () => {
    setIsLading(true);
    setTimeout(() => { setIsLading(false); }, 3000);
  };
  return (
    <div
      style={{
        width: '100%',
        height: '100%',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        background: '#000',
      }}
    >
      <button type="button" onClick={loading}>Start loading!</button>
      {isLoading ? <Loading /> : null}
    </div>
  );
};

Other type of animate

Basic Options

OptionDescriptionTypeDefault
typeHave five type of animate, expect accpect beat, bar, creeping, circle, orbiting.stringbeat
fillMain color about animate element.string#4b9cdb
zIndexWill be set z-index of CSS on animate wrapp.number10

Options Of Specialty Animate Type

beat

OptionDescriptionTypeDefault
diameterEach circle size of diameter.number15
gapGap of each circlenumber4

bar

OptionDescriptionTypeDefault
widthEach element size of width.number15
gapGap of each elementnumber4

creeping

OptionDescriptionTypeDefault
heightEach element size of height.number15
gapGap of each elementnumber4

circle

OptionDescriptionTypeDefault
diameterThe circle size of diameter.number15

orbiting

OptionDescriptionTypeDefault
diameterThe ring size of diameter.number15
1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.3

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.10

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.2.1

5 years ago

0.4.5

5 years ago

0.3.5

5 years ago

0.1.7

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.2.2

5 years ago

0.3.4

5 years ago

0.1.6

5 years ago

0.3.3

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.3

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

1.0.0

5 years ago