Socket
Socket
Sign inDemoInstall

@alptugidin/react-circular-progress-bar

Package Overview
Dependencies
5
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alptugidin/react-circular-progress-bar

A customizable circular progress bar for React.


Version published
Weekly downloads
425
increased by35.35%
Maintainers
1
Install size
36.5 kB
Created
Weekly downloads
 

Readme

Source

A customizable circular progress bar for React.

Demo


npm



Installation

npm install @alptugidin/react-circular-progress-bar

or

yarn add @alptugidin/react-circular-progress-bar

Import

import {Flat, Heat, Nested} from '@alptugidin/react-circular-progress-bar'

Usage

Flat

<Flat  
   progress={50}
   range={{ from: 0, to: 100 }}
   sign={{ value: '%', position: 'end' }}
   text={'Match'}
   showMiniCircle={true}
   showValue={true}
   sx={{
     strokeColor: '#ff0000',
     barWidth: 5, 
     bgStrokeColor: '#ffffff',
     bgColor: { value: '#000000', transparency: '20' },  
     shape: 'full',
     strokeLinecap: 'round',
     valueSize: 13,
     valueWeight: 'bold',
     valueColor: '#000000',
     valueFamily: 'Trebuchet MS',
     textSize: 13,
     textWeight: 'bold',
     textColor: '#000000',
     textFamily: 'Trebuchet MS',
     loadingTime: 1000,
     miniCircleColor: '#ff0000',
     miniCircleSize: 5,
     valueAnimation: true,
     intersectionEnabled: true
   }}
/>

Props

Prop nameTypeRequiredDescription
progressnumberYesThe progress value of the progress bar, ranging from 0 to 100.
rangeobjectNoAn object containing the from and to values for the progress bar. The default value is { from: 0, to: 100 }.
signobjectNoAn object containing the value and position for the sign displayed in the progress bar. The value can be a string, and the position can be either 'start' or 'end'. The default value is { value: '%', position: 'end' }.
textstringNoThe text displayed above the progress bar.
showMiniCirclebooleanNoA flag indicating whether to show a mini circle at the end of the progress bar. The default value is true.
showValuebooleanNoA flag indicating whether to show the progress value in the progress bar. The default value is true.
sxobjectNoAn object containing CSS styles for customizing the appearance of the progress bar.

Styling

PropertyTypeDescription
barWidthnumberThe width of the progress bar.
strokeColorstringThe color of the active progress bar.
bgStrokeColorstringThe color of the background progress bar.
bgColorobjectThe color of the background progress bar. It has two properties: value: hex color and transparency: number between 00-99 (as string)
shapestringThe shape of the progress bar. Can be 'full', 'half' or 'threequarters'.
strokeLinecapstringThe line cap style of the progress bar. Can be 'butt', 'round', or 'square'.
valueSizenumberThe font size of the progress value.
valueWeightstringThe font weight of the progress value.
valueColorstringThe color of the progress value.
valueFamilystringThe font family of the progress value.
textSizenumberThe font size of the text above the progress bar.
textWeightstringThe font weight of the text above the progress bar.
textColorstringThe color of the text above the progress bar.
textFamilystringThe font family of the text above the progress bar.
loadingTimenumberThe time it takes for the progress bar to animate from 0 to the specified progress value.
miniCircleColorstringThe color of the mini circle at the end of the progress bar.
miniCircleSizenumberThe size of the mini circle at the end of the progress bar.
valueAnimationbooleanA flag indicating whether to animate the progress value.
intersectionEnabledbooleanA flag indicating whether to use an intersection observer to only start loading the progress bar when it becomes visible on the screen. The default value is true.

Heat

<Heat
  progress={50}
  range ={{ from: 0, to: 100 }}
  sign={{ value: '%', position: 'end' }}
  showValue={true}
  revertBackground={false}
  text={'Match'}
  sx={{
    barWidth: 5,
    bgColor: '#dadada',
    shape: 'half',
    valueSize: 13,
    textSize: 13,
    valueFamily: 'Trebuchet MS',
    textFamily: 'Trebuchet MS',
    valueWeight: 'normal',
    textWeight: 'normal',
    textColor: '#000000',
    valueColor: '#000000',
    loadingTime: 1000,
    strokeLinecap: 'round',
    valueAnimation: true,
    intersectionEnabled: true
  }}
/>

Props

PropTypeDescription
progressnumberThe progress value of the progress bar, ranging from 0 to 100.
rangeobjectAn object containing the from and to values for the progress bar. The default value is { from: 0, to: 100 }.
signobjectAn object containing the value and position for the sign displayed in the progress bar. The value can be a string, and the position can be either 'start' or 'end'. The default value is { value: '%', position: 'end' }.
showValuebooleanA flag indicating whether to show the progress value in the progress bar. The default value is true.
revertBackgroundbooleanA flag indicating whether to invert the colors of the progress bar. If true, the background color will start as red and gradually turn green as the progress value increases. The default value is false.
textstringThe text displayed above the progress bar.
sxobjectAn object containing CSS styles for customizing the appearance of the progress bar.

Styling

PropertyTypeDescription
barWidthnumberThe width of the progress bar.
bgColorstringThe background color of the progress bar.
shapestringThe shape of the progress bar. Can be 'full' or 'half'.
valueSizenumberThe font size of the progress value.
textSizenumberThe font size of the text above the progress bar.
valueFamilystringThe font family of the progress value.
textFamilystringThe font family of the text above the progress bar.
valueWeightstringThe font weight of the progress value.
textWeightstringThe font weight of the text above the progress bar.
textColorstringThe color of the text above the progress bar.
valueColorstringThe color of the progress value.
loadingTimenumberThe time it takes for the progress bar to animate from 0 to the specified progress value.
strokeLinecapstringThe line cap style of the progress bar. Can be 'butt', 'round', or 'square'.
valueAnimationbooleanA flag indicating whether to animate the progress value.
intersectionEnabledbooleanA flag indicating whether to use an intersection observer to only start loading the progress bar when it becomes visible on the screen. The default value is true.

Nested

<Nested
  circles={[
    {text: 'Javascript', value: 20, color: '#fde047'},
    {text: 'Typescript' ,value: 50, color: '#0ea5e9'},
    {text: 'HTML', value: 8, color: '#c2410c'},
    {text: 'CSS', value: 12, color: '#7c3aed'},
    {text: 'SASS', value: 10, color: '#c026d3'}
  ]}
  sx={{
    bgColor: '#cbd5e1',
    fontWeight: 'bold',
    fontFamily: 'Trebuchet MS',
    strokeLinecap: 'round',
    loadingTime: 1000,
    valueAnimation: true,
    intersectionEnabled: true
  }}
/>

Props

PropTypeDescription
circlesarrayAn array of objects containing the properties for each circle in the nested progress bar. Each object should have a text string, a value number, and a color string. Must have at least two circles. Can be up to 5.
sxobjectAn object containing CSS styles for customizing the appearance of the nested progress bar.

Styling

PropertyTypeDescription
bgColorstringThe background color of the nested progress bar.
fontWeightstringThe font weight of the text in the nested progress bar.
fontFamilystringThe font family of the text in the nested progress bar.
strokeLinecapstringThe line cap style of the circles in the nested progress bar. Can be 'butt', 'round', or 'square'.
loadingTimenumberThe time it takes for the circles in the nested progress bar to animate from 0 to their specified values.
valueAnimationbooleanA flag indicating whether to animate the values in the circles of the nested progress bar.
intersectionEnabledbooleanA flag indicating whether to use an intersection observer to only start loading the nested progress bar when it becomes visible on the screen. The default value is true.

Licence

MIT Alptuğ İdin

Keywords

FAQs

Last updated on 17 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