1.1.1 • Published 22 days ago

react-progressbars-with-indicator v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

react-progressbars-with-indicator

A semicircle progress bar with an indicator for React applications. Originally forked from react-semicircle-progressbar

semicircle example

horizontal example

Installation

Use the package manager npm to install react-progressbars-with-indicator.

npm install react-progressbars-with-indicator

Usage

Semicircle Progress Bar

import React from 'react';
import SemiCircleProgressWithIndicator from 'react-progressbars-with-indicator';

function App() {
  return (
      <div>
        <SemiCircleProgressWithIndicator
            percentage={80}
            indicatorPercentage={50}
            strokeWidth={10}
            strokeColor="#f00"
            indicatorColor="#f00"
        />
      </div>
  );
}

export default App;

HorizontalProgressWithIndicator

import React from 'react';
import HorizontalProgressWithIndicator from 'react-progressbars-with-indicator';

function App() {
  return (
      <div>
        <HorizontalProgressWithIndicator
            percentage={80}
            indicatorPercentage={50}
            strokeWidth={10}
            strokeColor="#f00"
            indicatorColor="#f00"
        />
      </div>
  );
}

export default App;

Properties

SemiCircleProgressWithIndicator

PropertyTypeDescription
strokeWidthnumberThe width of the progress bar line in pixels
strokeLinecap"butt" | "round" | "square"The type of end cap for the progress bar line ("butt", "round", or "square")
percentagenumberThe percentage of the progress bar filled
indicatorPercentagenumberThe position of the indicator along the progress bar (null value hides indicator)
percentageSeparatorstringThe separator to use between the percentage and label text (default is "of")
strokeColorstringThe color of the progress bar line in hex
indicatorColorstringThe color of the indicator in hex
indicatorRelativeSizenumberThe size of the indicator relative to the stroke width of the progress bar line
includeTextbooleanThe text indicating percentage complete of the progress bar
fontStyle{ fontSize: string, fontFamily: string, fontWeight: string, fill: string }The style of the label text
hasBackgroundbooleanThe background of the progress bar
bgStrokeColorstringThe color of the progress bar background line in CSS

HorizontalProgressWithIndicator

PropertyTypeDescription
strokeWidthnumberThe width of the progress bar line in pixels
strokeLinecap"butt" | "round" | "square"The type of end cap for the progress bar line ("butt", "round", or "square")
percentagenumberThe percentage of the progress bar filled
indicatorPercentagenumberThe position of the indicator along the progress bar (null value hides indicator)
strokeColorstringThe color of the progress bar line in hex
indicatorColorstringThe color of the indicator in hex
indicatorRelativeSizenumberThe size of the indicator relative to the stroke width of the progress bar line
customTextstringCustom text that is displayed inside the progress bar
textPosition'start' | 'end' | 'middle'The position of the custom text inside the progress bar
fontStyle{ fontFamily: string, fontWeight: string, fill: string }The style of the label text
hasBackgroundbooleanThe background of the progress bar
bgStrokeColorstringThe color of the progress bar background line in CSS

Testing (development only)

This project has Storybook installed for testing purposes. To run the storybook, use the following command:

npm run storybook

Note that storybook only works in this repository - it is not available in the npm package.

License

MIT

1.1.1

22 days ago

1.1.0

22 days ago

1.0.5

23 days ago

1.0.4

23 days ago

1.0.3

23 days ago

1.0.2

23 days ago

1.0.1

23 days ago

1.0.0

23 days ago