Socket
Socket
Sign inDemoInstall

@ramonak/react-progress-bar

Package Overview
Dependencies
5
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ramonak/react-progress-bar

> Progress Bar React Component


Version published
Weekly downloads
26K
increased by2.7%
Maintainers
1
Install size
28.6 kB
Created
Weekly downloads
 

Readme

Source

@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, outside
rightPosition 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-out
ease-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, auto
ltrProgressbar 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

Keywords

FAQs

Last updated on 28 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc