1.0.0 • Published 4 years ago

@jswork/react-progress v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-progress

Progress for react.

version license size download

installation

npm install -S @jswork/react-progress

properties

NameTypeRequiredDefaultDescription
classNamestringfalse-The extended className for component.
colorstringfalse'#419bf9'The highlight body color.
valuenumberfalse0The progress value.
maxnumberfalse100The max limit value.

usage

  1. import css

    @import "~@jswork/react-progress/dist/style.css";
    
    // or use sass
    @import "~@jswork/react-progress/dist/style.scss";
    
    // customize your styles:
    $react-progress-options: ()
  2. import js

    import ReactDemokit from '@jswork/react-demokit';
    import React from 'react';
    import ReactDOM from 'react-dom';
    import ReactProgress from '@jswork/react-progress';
    import './assets/style.scss';
    
    class App extends React.Component {
      get items() {
        return Array.from(Array(10).keys());
      }
    
      render() {
        return (
          <ReactDemokit
            className="p-3 app-container"
            url="https://github.com/afeiship/react-progress">
            <article className="message is-info">
              <div className="message-header">Preview:</div>
              <div className="message-body">
                <h3 className="mb-3">
                  <center className="button is-primary">Progress bar</center>
                </h3>
                {this.items.map((item) => {
                  return (
                    <ReactProgress
                      className="mb-2"
                      key={item}
                      value={item * 10 + 10}
                    />
                  );
                })}
              </div>
            </article>
          </ReactDemokit>
        );
      }
    }
    
    ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.