GithubHelp home page GithubHelp logo

manprajapat / react-button-loaders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victufell/react-button-loaders

0.0 1.0 0.0 535 KB

A collection of loading buttons easily customizable.

Home Page: https://victorvoid.me/react-button-loaders/

License: MIT License

JavaScript 100.00%

react-button-loaders's Introduction

logo

Build Status NPM version node version npm download

A collection of loading buttons easily customizable.

๐Ÿ’ Demo

Install ๐Ÿ“

$ npm install react-button-loaders --save

Usage ๐Ÿ‘“

import React, { Component } from 'react'
import { Lion as Button } from 'react-button-loaders'

class App extends Component {
  state = {
    sendState: ''
  }
  
  handleClick = () => {
    this.setState({sendState: 'loading'})
    //simulating an API
    setTimeout(() => {
      this.setState({sendState: 'finished'})
    }, 3000)
  }
  
  render(){
    return (
      <section>
        <Button onClick={this.handleClick} state={this.state.sendState}>Send</Button>
      </section>
    )
  }
}

export default App

Common API ๐Ÿ’ก

The following APIs are shared by all Buttons.

Name Type Default Description
className string '' Additional CSS class for the button
state string loading, finished The button state to render
speedProgress number 3000 The loading speed
speedIconLoader number 800 The speed of icon loading
refreshComponent Component Component Change the component that is displayed while loading
checkComponent Component Component Change the icon component that is displayed while loading
onClick Function NOOP onClick will be triggered when button is Clicked
bgColor string #F06189 #F06189 Change background button color
bgLoading string #F06189 #F06189 Change background button color when is loading
bgWhenFinish string #4AD481 #4AD481 Change background button color when is loaded
bgLoadingBehind string #D7E3EF #D7E3EF Change background color if loader has 2 backgrounds

Available buttons ๐ŸŽฃ

Help us create more awesome buttons ๐Ÿ’

npm install
npm start

License

react-button-loaders is released under the MIT license.

react-button-loaders's People

Contributors

rv-vmartins avatar victorvoid avatar victufell avatar

Watchers

 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.