项目作者: nozzlegear

项目描述 :
An indefinite circular progress inspired by Google's progress indicator. Based off of https://github.com/nathanhoad/react-loading-animation.
高级语言: TypeScript
项目地址: git://github.com/nozzlegear/react-svg-progress.git
创建时间: 2017-02-13T00:03:33Z
项目社区:https://github.com/nozzlegear/react-svg-progress

开源协议:MIT License

下载


@nozzlegear/react-svg-progress

An indefinite circular progress inspired by Google’s progress indicator. Based off of https://github.com/nathanhoad/react-loading-animation.

Screeshot of React SVG Progress

Installation

With Yarn:

  1. yarn install @nozzlegear/react-svg-progress

Or from @nozzlegear/react-svg-progress">NPM:

  1. npm install @nozzlegear/react-svg-progress --save

Importing

The component can be imported like so:

  1. import { CircularProgress } from "@nozzlegear/react-svg-progress";
  2. import CircularProgress from "@nozzlegear/react-svg-progress";

Example

  1. import CircularProgress from "@nozzlegear/react-svg-progress";
  2. function MyComponent() {
  3. return (
  4. <div>
  5. <div>
  6. {`40px:`}
  7. <CircularProgress size={40} strokeWidth={7} ></CircularProgress>
  8. </div>
  9. <div>
  10. {`Green:`}
  11. <CircularProgress size={40} color={"green"} ></CircularProgress>
  12. </div>
  13. <div>
  14. {`In Button:`}
  15. <button className={`btn blue`} >
  16. <CircularProgress size={15} margin={"0 5px 0 0"} color={`#ffffff`} ></CircularProgress>
  17. {`Button Text`}
  18. </button>
  19. </div>
  20. </div>
  21. )
  22. }

Props

Note: react-svg-progress has full TypeScript definitions! You should automatically receive intellisense for all of the props documented below:

Name Type Required Default Description
color string false '#00bcd4' The progress indicator’s color. Must be a valid CSS color string.
size number or string false 16 A number or string designating the size of the SVG. If a string, the property must be a valid CSS height and width value.
margin string false undefined A valid CSS margin string.
strokeWidth number false 5 Stroke width of the progress indicator.