content logo

React Progress Bars:

React Progress Bar with Percentage Adjustment Button

Do you have a website and want to show your progress to your customers? We have provided a fantastic code that is designed to display your progression on your website in a beautiful way. This code is the React Progress Bar with Percentage Adjustment Button with an attractive design. As you know, one of the most critical subjects in websites is simplicity. The Progress Bar with Button is totally simple, and you can apply it on every kind of website. With the help of this amazing JavaScript Free Progress Bar, you can change the appearance of your website and represent your progression beautifully.

You can see the following preview of this Progress Bar Percentage and realize its functionality. There is a field in the middle of the page with a black border. There is a blue circle at the beginning of this field, and the rest of it is white. You can see a blue filled above the Progress Bar Adjusting Button with white writing. It is written “Set to 100%” and as soon as you press this field, the bottom area will move forward, and the whole field will change to blue. In other words, the progression will be completed.

#

Progress Bar with Button

#

Javascript Free Progress Bar

#

Progress Bar Percentage

#

Progress Bar Adjusting Button

<!-- This script got from frontendfreecode.com -->
<div id="progress-bar"></div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.progress-container {
  background: #555;
  padding: 3px;
  width: 50%;
  border-radius: 10px;
}
.bar {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.7s ease-out;
  border-radius: 10px;
  background: dodgerblue;
  width: 50%;
  height: 20px;
  color: white;
}
button {
  margin-bottom: 20px;
  border: 0;
  background: dodgerblue;
  color: white;
  padding: 5px 10px 5px 10px;
  cursor: pointer;
}
button:hover {
  background: #005db7;
}
class ProgressBar extends React.Component {
    constructor() {
        super();
        this.state = {
            progress: "10%"
        };
    }
    handleClick() {
        this.setState({
            progress: "100%"
        });
    }
    render() {
        const styles = {
            width: this.state.progress
        };
        return /*#__PURE__*/(
            React.createElement("div", { className: "container" }, /*#__PURE__*/
                React.createElement("button", { onClick: this.handleClick.bind(this) }, "Set to 100%"), /*#__PURE__*/
                React.createElement("div", { className: "progress-container" }, /*#__PURE__*/
                    React.createElement("div", { className: "bar", style: styles }))));
    }
}
ReactDOM.render( /*#__PURE__*/React.createElement(ProgressBar, null), document.getElementById("progress-bar"));
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.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/normalize/5.0.0/normalize.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>
.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.progress-container {
  background: #555;
  padding: 3px;
  width: 50%;
  border-radius: 10px;
}
.bar {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.7s ease-out;
  border-radius: 10px;
  background: dodgerblue;
  width: 50%;
  height: 20px;
  color: white;
}
button {
  margin-bottom: 20px;
  border: 0;
  background: dodgerblue;
  color: white;
  padding: 5px 10px 5px 10px;
  cursor: pointer;
}
button:hover {
  background: #005db7;
}
</style>

</head>
<body>
<div id="progress-bar"></div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
class ProgressBar extends React.Component {
    constructor() {
        super();
        this.state = {
            progress: "10%"
        };
    }
    handleClick() {
        this.setState({
            progress: "100%"
        });
    }
    render() {
        const styles = {
            width: this.state.progress
        };
        return /*#__PURE__*/(
            React.createElement("div", { className: "container" }, /*#__PURE__*/
                React.createElement("button", { onClick: this.handleClick.bind(this) }, "Set to 100%"), /*#__PURE__*/
                React.createElement("div", { className: "progress-container" }, /*#__PURE__*/
                    React.createElement("div", { className: "bar", style: styles }))));
    }
}
ReactDOM.render( /*#__PURE__*/React.createElement(ProgressBar, null), document.getElementById("progress-bar"));
</script>

</body>
</html>
Preview