content logo

React Progress Bars:

React Circular Progress Bar with Different Styles

You can use different kinds of codes to make a variety on your website. We have a code with a different style that allows you to change the appearance of your website beautifully. This code is the React Circular Progress Bar with Different Styles. With the help of this amazing React Red Progress Bar, you can use different kinds of styles on your website and attract more viewers. People are attracted to eye-catching designs, and if you want to gain more audiences, this JavaScript Stylish Progress Bar is a great idea.

The preview of these Free React Source Codes are located down, and you can look at them to be aware of this code's performance. When you look at this preview, you can understand that it has a simple design with a different style. This Progress Bar with Label contains three styles, and you can choose whatever you like. All of the progress bars are circular, and the progression is represented around the circle. The first one has a thick border in red color, the second one is thin, and the last one is normal. The amount of progression is displayed in the center of each circle with its own percentage.

#

React Red Progress Bar

#

Progress Bar with Label

#

Free React Source Codes

#

Javascript Stylish Progress Bar

<!-- This script got from frontendfreecode.com -->
<div id="container"></div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
.percentage-circle {
  position: relative;
}
.percentage-circle__circle {
  stroke-dashoffset: 0;
  transform-origin: 50%;
  position: absolute;
  transform: rotate(-90deg);
}
.percentage-circle__percentage {
  font-family: sans-serif;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
var ProgressSvg = React.createClass({ displayName: "ProgressSvg",
  getDefaultProps: function () {
    return {
      speed: 2,
      strokeWidth: 10,
      circleSize: 100 };
  },
  render: function () {
    let toDasharray = this.props.circleSize * 3.14;
    let innerRadius = this.props.circleSize / 2 - this.props.strokeWidth / 2;
    let outerRadius = this.props.circleSize / 2;
    let scale = innerRadius / outerRadius;
    let percentage = Math.floor(3.14 * this.props.percentage * scale * (this.props.circleSize / 100));
    let uniqueModifier = Math.floor(Math.random() * 100000);
    return /*#__PURE__*/(
      React.createElement("div", { className: 'percentage-circle' + ' ' + 'percentage-circle--' + uniqueModifier }, /*#__PURE__*/
      React.createElement("style", null,
      `
                        @-webkit-keyframes animate-progress-bar--${uniqueModifier} {
                            0% { stroke-dasharray: 0 ${toDasharray}; }
                          100% { stroke-dasharray: ${percentage} ${toDasharray}; }
                        }
                       @keyframes animate-progress-bar {
                            0% { stroke-dasharray: 0 ${toDasharray}; }
                          100% { stroke-dasharray: ${percentage} ${toDasharray}; }
                        }
						
						.percentage-circle--${uniqueModifier} {
							width: ${this.props.circleSize}px;
							height: ${this.props.circleSize}px;
						}
                        .percentage-circle__circle--${uniqueModifier} {
                            animation: animate-progress-bar--${uniqueModifier} ${this.props.speed}s cubic-bezier(.87, -.41, .19, 1.44);
                            animation-fill-mode: forwards;
                        }
                    `),
      this.props.showpercentage ? /*#__PURE__*/
      React.createElement("div", { className: "percentage-circle__percentage" },
      this.props.percentage, "%") :
      false, /*#__PURE__*/
      React.createElement("svg", {
        height: this.props.circleSize,
        width: this.props.circleSize }, /*#__PURE__*/
      React.createElement("circle", {
        cx: outerRadius,
        cy: outerRadius,
        r: innerRadius,
        stroke: "lightgrey",
        strokeWidth: this.props.strokeWidth,
        fill: "none" }), /*#__PURE__*/
      React.createElement("circle", {
        cx: outerRadius,
        cy: outerRadius,
        className: 'percentage-circle__circle' + ' ' + 'percentage-circle__circle--' + uniqueModifier,
        r: innerRadius,
        stroke: "red",
        strokeWidth: this.props.strokeWidth,
        fill: "none" }))));
  } });
ReactDOM.render( /*#__PURE__*/
React.createElement("div", null, /*#__PURE__*/
React.createElement(ProgressSvg, { percentage: "25" }), /*#__PURE__*/
React.createElement(ProgressSvg, { strokeWidth: "1", percentage: "50", speed: "2" }), /*#__PURE__*/
React.createElement(ProgressSvg, { strokeWidth: "5", circleSize: "200", percentage: "99", showpercentage: true, speed: "2" })),
document.getElementById('container'));
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js'></script>
<style>
.percentage-circle {
  position: relative;
}
.percentage-circle__circle {
  stroke-dashoffset: 0;
  transform-origin: 50%;
  position: absolute;
  transform: rotate(-90deg);
}
.percentage-circle__percentage {
  font-family: sans-serif;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
</style>

</head>
<body>
<div id="container"></div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
var ProgressSvg = React.createClass({ displayName: "ProgressSvg",
  getDefaultProps: function () {
    return {
      speed: 2,
      strokeWidth: 10,
      circleSize: 100 };
  },
  render: function () {
    let toDasharray = this.props.circleSize * 3.14;
    let innerRadius = this.props.circleSize / 2 - this.props.strokeWidth / 2;
    let outerRadius = this.props.circleSize / 2;
    let scale = innerRadius / outerRadius;
    let percentage = Math.floor(3.14 * this.props.percentage * scale * (this.props.circleSize / 100));
    let uniqueModifier = Math.floor(Math.random() * 100000);
    return /*#__PURE__*/(
      React.createElement("div", { className: 'percentage-circle' + ' ' + 'percentage-circle--' + uniqueModifier }, /*#__PURE__*/
      React.createElement("style", null,
      `
                        @-webkit-keyframes animate-progress-bar--${uniqueModifier} {
                            0% { stroke-dasharray: 0 ${toDasharray}; }
                          100% { stroke-dasharray: ${percentage} ${toDasharray}; }
                        }
                       @keyframes animate-progress-bar {
                            0% { stroke-dasharray: 0 ${toDasharray}; }
                          100% { stroke-dasharray: ${percentage} ${toDasharray}; }
                        }
						
						.percentage-circle--${uniqueModifier} {
							width: ${this.props.circleSize}px;
							height: ${this.props.circleSize}px;
						}
                        .percentage-circle__circle--${uniqueModifier} {
                            animation: animate-progress-bar--${uniqueModifier} ${this.props.speed}s cubic-bezier(.87, -.41, .19, 1.44);
                            animation-fill-mode: forwards;
                        }
                    `),
      this.props.showpercentage ? /*#__PURE__*/
      React.createElement("div", { className: "percentage-circle__percentage" },
      this.props.percentage, "%") :
      false, /*#__PURE__*/
      React.createElement("svg", {
        height: this.props.circleSize,
        width: this.props.circleSize }, /*#__PURE__*/
      React.createElement("circle", {
        cx: outerRadius,
        cy: outerRadius,
        r: innerRadius,
        stroke: "lightgrey",
        strokeWidth: this.props.strokeWidth,
        fill: "none" }), /*#__PURE__*/
      React.createElement("circle", {
        cx: outerRadius,
        cy: outerRadius,
        className: 'percentage-circle__circle' + ' ' + 'percentage-circle__circle--' + uniqueModifier,
        r: innerRadius,
        stroke: "red",
        strokeWidth: this.props.strokeWidth,
        fill: "none" }))));
  } });
ReactDOM.render( /*#__PURE__*/
React.createElement("div", null, /*#__PURE__*/
React.createElement(ProgressSvg, { percentage: "25" }), /*#__PURE__*/
React.createElement(ProgressSvg, { strokeWidth: "1", percentage: "50", speed: "2" }), /*#__PURE__*/
React.createElement(ProgressSvg, { strokeWidth: "5", circleSize: "200", percentage: "99", showpercentage: true, speed: "2" })),
document.getElementById('container'));
</script>

</body>
</html>
Preview