Giter Site home page Giter Site logo

respinner's Introduction

Respinner

react components for spinners or loaders. Each loader was combined css animation and render dom as svg. easily controlled by react porps.

You could change the count of spinner's children by props count, also the color of themselves. All of them built with SVG, so you can easily scale them with width and height.

Examples

demo

See more details in demo directory or visit website: huozhi.github.io/respinner/

Usage

npm install --save respinner

Yet 7 kinds of loaders supported, just import it when use with react. Any suggestions on issues.

import React, {Component} from 'react'
// easily import from entry
import {
  BeatLoading, BounceLoading, CircularLoading,
  ClockLoading, RotateLoading, SpinLoading,
  WaveLoading, DashLoading, CopperLoading
} from 'respinner'
// or import single spinner directly, smaller size if your code don't have tree shaking
import SpinLoading from 'respinner/lib/spin'

class LoadingComponents extends Component {  
  render() {
    <div className="spinners">
      <SpinLoading fill="#777" borderRadius={4} count={12} /> // use with customized props
      <CircularLoading /> // or just use with default props
    </div>
  }
}

Dist directory

lib
โ”œโ”€โ”€ beat.js
โ”œโ”€โ”€ bounce.js
โ”œโ”€โ”€ circular.js
โ”œโ”€โ”€ clock.js
โ”œโ”€โ”€ dash.js
โ”œโ”€โ”€ index.js
โ”œโ”€โ”€ rotate.js
โ”œโ”€โ”€ spin.js
โ”œโ”€โ”€ copper.js
โ””โ”€โ”€ wave.js

API

Common Props

  • className
  • width
  • height
  • stroke/fill (stroke for circle ones, fill for rectangle ones)

1. BeatLoading

  • gap: default 6
  • size: default 8
  • count: default 6
  • duration: default 0.8

2. CircularLoading

  • size: default 40
  • strokeWidth: default 4
  • linecap: default 'round'

3. BounceLoading

  • gap: default 6
  • count: default 4
  • barWidth: default 4
  • barHeight: default 16
  • duration: default 0.8

4. RotateLoading

  • size: default 40
  • opacity: default 0.2
  • strokeWidth: default 4

5. SpinLoading

  • size: default 40
  • count: default 8
  • barWidth: default 4
  • duration: default 1
  • barHeight: default 10
  • borderRadius: default 1

6. WaveLoading

  • size: default 40
  • count: default 3
  • duration: default 1.5
  • strokeWidth: default 2

7. ClockLoading

  • size
  • duration
  • strokeWidth

8. DashLoading

  • size: default 40
  • duration: default 1.8
  • stroke

9. CopperLoading

  • size: default 40
  • strokeWidth: default 4

Development

npm install
npm start

# see demo in http://localhost:3000

Build

npm run build

respinner's People

Contributors

huozhi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.