5.2.0 • Published 4 months ago

@ramonak/react-progress-bar v5.2.0

Weekly downloads
922
License
MIT
Repository
github
Last release
4 months ago

@ramonak/react-progress-bar

Progress Bar React Component

NPM npm bundle sizeGitHubnpm


demo


Playground / Code Generator


Install

npm install --save @ramonak/react-progress-bar

Usage

import React from "react";

import ProgressBar from "@ramonak/react-progress-bar";

const Example = () => {
  return <ProgressBar completed={60} />;
};

Examples

Label without "%" at the end

example1

<ProgressBar completed="60">

Max completed value is greater than 100

example1

<ProgressBar completed={180} maxCompleted={200} />

Custom Label

example1

<ProgressBar completed={60} customLabel="Not there yet" />

Custom class names

example1

//styles.scss

.wrapper {
  border: 3px solid blue;
}

.container {
  background-color: pink;
}

.barCompleted {
  background-color: lightblue;
  width: 80%;
}

.label {
  font-size: 20px;
  color: green;
}
import './styles.scss'

...

<ProgressBar
  completed={80}
  className="wrapper"
  barContainerClassName="container"
  completedClassName="barCompleted"
  labelClassName="label"
/>

Props

NameTypeDefaultDescription
completed (required)Number or stringPercentage of completed progress bar value. If a string, the "%" won't be added to the label. See Examples
maxCompletednumber100Max possible value of the completed prop
customLabelstringundefinedCustom label
bgColorstring#6a1b9aColor of the completed bar
heightstring20pxHeight of the bar
widthstring100%Width of the bar
marginstringMargin
paddingstringPadding
borderRadiusstring50pxBorder radius of the bar
baseBgColorstring#e0e0deColor of the "non-completed" bar
labelAlignmentstring: left, center, right, outsiderightPosition of the label inside the completed bar or outside bar
labelColorstring#fffColor of the label text
labelSizestring15pxFont-size of the label text
isLabelVisiblebooleantrueVisibility of the label
transitionDurationstring1sDuration of the width transition
transitionTimingFunctionstring: ease, linear, ease-in, ease-out, ease-in-outease-in-outTiming function of the width transition
animateOnRenderbooleanfalseShould the bar width be animated on the first render
initCompletedOnAnimationstring or number0Initial completed value (e.g. the width of the completed bar) on animation start (applies only when animateOnRender is true)
classNamestringAdd a className to the parent div (see example)
barContainerClassNamestringAdd a className to the container div (see example)
completedClassNamestringAdd a className to the completed part of the bar (see example)
labelClassNamestringAdd a className to the bar label (see example)
dirstring: ltr, rtl, autoltrProgressbar HTML direction
ariaValueminnumber0accessibility: Defines the minimum allowed value for a range
ariaValuemaxnumber100accessibility: Defines the maximum allowed value for a range
ariaValuetextnumbernullaccessibility: Defines the human readable text alternative of aria-valuenow (defaults to completed if not passed)
customLabelStylesCSS.Propertiescustom CSS properties for a label

License

MIT © KaterinaLupacheva

5.2.0

4 months ago

5.1.1

5 months ago

5.1.0

5 months ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.4.0

2 years ago

4.3.0

2 years ago

4.1.0

2 years ago

4.2.0

2 years ago

3.3.1

3 years ago

3.3.0

3 years ago

4.0.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.1.8

3 years ago

2.1.7

3 years ago

2.1.4

3 years ago

2.1.6

3 years ago

2.1.5

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.2.3

3 years ago

2.0.0

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago