# react-interactive-progress-bar

> NPM package React component for an interactive progress bar

Latest version **2.0.0** (published 2023-11-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install react-interactive-progress-bar
pnpm add react-interactive-progress-bar
yarn add react-interactive-progress-bar
bun add react-interactive-progress-bar
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-11-02 |
| First published | 2022-05-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 44.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | notliu |
| Maintainers | notliu |
| Keywords | react, typescript, npm |

## Links

- npm: https://www.npmjs.com/package/react-interactive-progress-bar
- Repository: https://github.com/notliu/npm-reactinteractiveprogressbar
- Homepage: https://github.com/notliu/npm-reactinteractiveprogressbar#readme
- Issues: https://github.com/notliu/npm-reactinteractiveprogressbar/issues
- npm.io page: https://npm.io/package/react-interactive-progress-bar

## Dependencies (2)

- [react-icons](https://npm.io/package/react-icons.md) ^4.11.0
- [styled-components](https://npm.io/package/styled-components.md) ^5.3.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-11-02
- 1.0.0 — 2022-05-04

## README

# React-Interactive-Progress-Bar

## Overview

### React Interactive Progress Bar

A simple React component for creating a simple customizable interactive progress bar.
Use cases:

- Keep track of progress for different elements in segments
- Interactive widget for selecting values in customizable segments
- Health Bar! Progress Bar! Resource Bar!

## How to Use

#### install npm package

`npm install react-interactive-progress-bar`

#### Put it into your project

#### No props passed

`<ProgressBar />`:\
![Alt text](image.png)

#### {primaryColor, secondaryColor, tertiaryColor} props passed (strings)

- primaryColor for fill color
- secondaryColor for negative fill color
- tertiaryColor for border, notches, outline, edit arrow colors

      <ProgressBar primaryColor="#cb362b" secondaryColor="#2e7858" tertiaryColor="#112142" />

  ![Alt text](image-1.png)

#### {segments} props passed to define number of sections

    <ProgressBar primaryColor="#cb362b" secondaryColor="#2e7858" tertiaryColor="#112142" segments={10} />

![Alt text](image-2.png)

#### {edit} props passed to toggle user interactivity / disable

    <ProgressBar primaryColor="#cb362b" secondaryColor="#2e7858" tertiaryColor="#112142" segments={10} edit={false} />

![Alt text](image-3.png)

#### {fill, width} props passed to predefine # segments filled and width of bar

    <ProgressBar primaryColor="#cb362b" secondaryColor="#2e7858" tertiaryColor="#112142" segments={10} edit={true} fill={fillState} width={"50rem"} />

![Alt text](image-4.png)

#### {stateHandler} props passed to custom define a state function with the current fill value passed as an argument

![Alt text](image-5.png)

# Props

All props are optional

    segments?: number
    fill?: number
    primaryColor?: string
    secondaryColor?: string
    tertiaryColor?: string
    edit?: boolean
    width?: string

- primaryColor - fill color
- secondaryColor - negative fill color
- tertiaryColor - border, notch, edit arrow color
- segments - number of segments on progress bar
- edit - toggle interactivity of progress bar
- fill - initial fill value of progress bar
- width - width of progress bar
- stateHandler - function that accepts current fill value as argument

## How to Develop

### Code courtesy of npm react package template

To compile your code once, run

- `npm run build`.

To compile your code once and refresh on file change, run

- `npm run start`.

To publish your package to npm, make sure you're logged in the correct account by running

- `npm login`.

Compile your package by running

- `npm run build`

Update the package version accordingly by using

- [`npm version [patch | minor | major]`](https://docs.npmjs.com/about-semantic-versioning)

Then publish your package by running

- `npm publish`

## Release Notes

#### `v2.0.0` Second Release:

- Remove unused code, clean up code, standardize code and styling
- Fix independent tracker functionality
- Make design responsive and redesign component!
- Fix custom color importing
- Fix props and width styling

#### `v1.0.0` Initial Release:

- Code taken and refactored to run independent from the Commission Tracker project
- First release to NPM!

---
_Source: https://npm.io/package/react-interactive-progress-bar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
