1.1.0 • Published 5 years ago

styled-loaders-react v1.1.0

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

styled-loaders-react

Build Status npm version

Loaders for React built with Styled Components.

Credits

This is React clone of SaraVieira 's amazing styled-loaders which provides loaders for Preact.

Huge thanks for all the hard work and letting me port it for React users.

Any new loaders that will be added in that original repository will be cloned here.

Usage

npm install styled-loaders-react

or

yarn add styled-loaders-react
import React from 'react'
import { Cube } from 'styled-loaders-react'

const Page = ({ loading }) =>
    <div>
        { loading ?
            <Cube/>
            : 'Your Content'
        }
    </div>

With Props

import React from 'react'
import { Block } from 'styled-loaders-react'

const Page = ({ loading }) =>
    <div>
        { loading ?
            <Block color="red" size="60px" duration="5s" />
            : 'Your Content'
        }
    </div>

Loaders

  • Bar Bar Props bgBar - Background of the bar default is #efefef color - Color of the bar default is #333 duration - Animation duration default is 0.5s
  • Block Block Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px
  • Circular Circular Props color - Background of the spinner default is #333 * size - Size of the spinner default is 40px
  • Cube Cube Props color - Background of the spinner default is #333 size - Size of the spinner default is 40px cubeSize - Size of the each cube default is 15 * duration - Animation duration default is 1.2s
  • CubeGrid CubeGrid Props color - Background of the spinner default is #333 * size - Size of the spinner default is 40px
  • DotScale DotScale Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px * dotSize - Size of the dots default is 18px
  • Pulsate Pulsate Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px
  • RotateScale RotateScale Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px
  • Scale Scale Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px
  • Stretch Stretch Props color - Background of the spinner default is #333 duration - Animation duration default is 1.2s size - Size of the spinner default is 40px * rectWidth - Width of each rectangle default is 6px

License

MIT