1.2.5 • Published 20 days ago

react-percentage-bar v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
20 days ago
npm i react-percentage-bar

Install with bun:

bun add react-percentage-bar

Install with yarn:

yarn add react-percentage-bar

Install with pnpm:

pnpm add react-percentage-bar

Usage

Import the progress bar components:

import { CircularProgressBar } from "react-percentage-bar";
import { LinearProgressBar } from "react-percentage-bar";

Now you can use both components like bellow.

Use with default styles:

<CircularProgressBar/>
<LinearProgressBar/>

Use with props:

<CircularProgressBar
 size={"2rem"}
 radius={"10rem"}
 roundLineCap={false}
 styles="separators"
 text={"Python"}
/>
<LinearProgressBar
 percentage={90}
 percentagePosition={"onright"}
 text={"Python"}
 percentageColor={"white"}
/>

Props

Common props:

This props are work with both <CircularProgressBar/> and <LinearProgressBar/>.

NameDescriptionDefaultReq. Data Types
textText to display inside the component.nullstring
textStyleAdd Custom styles for styling the text value.nullobject
percentagePercentage of the progress bar.75number
showPercentagePercentage value show or not inside component.trueboolean
colorColor or color gradient of progress bar.#0ea5e9string or string array
trackColorColor of the progress bar track.#efefefstring
durationForward animation total duration in ms. 1% get duration / 1002000number
animationProgress bar animated or not.trueboolean
percentageAnimationPresentage value animated or not.trueboolean
roundLineCapProgress bar start and end points rounded or not.trueboolean

LinearProgressBar only props:

This props are work with only <LinearProgressBar/> components.

NameDescriptionDefaultReq. Data Types
percentageColorColor of the percentage value.#00235Bstring
widthMaximum width (100%) of the progress bar.★20remstring or number
heightHeight of the progress bar.★0.8remstring or number
percentagePositionPercentage value show position.★★rightstring
startDirectionProgress bar 0% based direction.Value must be a left or rightleftstring

❇️ NOTE :

★ All measurements must be one of number , em , px , rem value. ★★ Value must be one of left , right , onleft or onright

CircularProgressBar only props:

This props are work with only <CircularProgressBar/> components.

NameDescriptionDefaultReq. Data Types
radiusRadius value of the progress circle.★5remstring or number
stylesProgress circle style.★★solidstring
sizeProgress circle stroke width.★1remstring or number
startPositionProgress circle 0% based position (0 is top most point). + values clockwisely and - values anti-clockwisely change the start position.0string or number
shadowShadows add or not for progress circle.falseboolean
innerShadowStyleAdd Custom styles for progress circle inside shadow.nullobject
outerShadowStyleAdd Custom styles for progress circle outside shadow.nullobject
percentageStyleAdd Custom styles for percentage value.nullobject
reverseProgress circle reverse animation add or not.trueboolean
reverseDurationDuration of the reverse animation.(follow durationprop constraints)2000number
loopCountProgress circle animations iterations count.0number or Infinity
startDelayForward animation start delay. (Not affect to 1st iteration)100number
reverseDelayBackward animation start delay.100number
antiClockWiseProgress circle forward direction is anti-clockwise or not.falseboolean
paddingGap between progress circle and background circle.0string or number
backgroundColorColor of the background circle.transparentstring
separatorIf styles is separators , customize separators width , count and color.✦[5, 12, "#fff"]array
chartValueIf styles is pie-chart , customize sections end percentages and color.✦✦{ 20: "#9CB4CC", 60: "#0EA293", 100: "#FFA559" }object

❇️ NOTE :

★ All measurements must be one of number , em , px , rem value. ★★ Value must be one of solid , pie-chart or separatorsSeparator require array follow this format [width , count , color] ✦✦ chartValue require object follow this format {percentage-1:color , percentage-2:color}

CircularProgressBar with children.

<CircularProgressBar/> component allows to work with childrens. It's allows to use more than percentage and text value inside the circular progress bar.

<CircularProgressBar>
    <ChildrenComponent/>
<CircularProgressBar/>

License

View License

1.2.4-beta.4

20 days ago

1.2.4-beta.1

20 days ago

1.2.4-beta.0

20 days ago

1.2.4-beta.3

20 days ago

1.2.5

20 days ago

1.2.4-beta.2

20 days ago

1.2.4

20 days ago

1.2.3

1 month ago

1.2.2

2 months ago

1.2.0

2 months ago

1.2.1

2 months ago

1.1.2

7 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago