JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 73
  • Score
    100M100P100Q66538F
  • License MIT

Simple progress arc for React, customizable with styled-components

Package Exports

  • progress-arc-component

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (progress-arc-component) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Simple progress arc for React

Demo

Installation

With yarn:

$ yarn add progress-arc-component

With npm:

$ npm install --save progress-arc-component

Usage

import ProgressArc from 'progress-arc-component'

class Default extends Component {
  state = {
    prog: 50
  }

  render() {
    let { prog } = this.state

    return (
      <div>
        <ProgressArc value={prog}/>

        <input
          type="range"
          min="0" max="100"
          value={prog}
          onChange={e => this.setState({prog: e.target.value})}
        />
      </div>
    )
  }
}

Properties

  • value - Current progress
  • max - Maximum value
  • unit - Value unit (% by default)

Customization

ProgressArc generates SVG that can be tweaked with styled-components:

import styled from 'styled-components'

const StyledProgressArc = styled(ProgressArc)`
  height: 12em;
  width: 12em;
  border: 0.3em solid black;
  border-radius: 0.5em;
  padding: 1em;
  circle {
    stroke: red;
  }
  text {
    fill: black;
  }
`