content logo

React Progress Bars:

Multi-Colored React Progress Bar with Range Slider

It is better to choose some bootstraps for your website to attract more followers. In this part, the Multi-Colored React Progress Bar with Range Slider is presented with a different theme. By using this Progress Bar Color Effect, you can change the design and theme of your page and attract a lot of viewers because it is so attractive. It is worth noting that the Progress Bar and Range Slider are suitable for colorful and white-designed websites since it has a nice harmony with these colors. There is a preview of this code below that represents the progress bar elements.

This Colorful Progress Bar has a blue background with white text. There are two lines on this page. One of these lines is located in the upper and the other one is placed on the downer side of the page. The upper line shows the progress percentage in orange color and the percentage is shown down with white text. The downer line is adjustable and you can change your progression. As you drag this line to the right side, the white line turns blue. To gain more audiences, download this Free React Progress Bar Code.

 

#

Progress Bar Color Effect

#

Progress Bar and Range Slider

#

Colorful Progress Bar

#

Free React Progress Bar Code

<!-- This script got from frontendfreecode.com -->
<div id="progress"></div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
[data-reactroot], body {
	display: flex;
	align-items: center;
	justify-content: center;
}
* {
	box-sizing: border-box;
}
body {
	flex-direction: column;
	height: 100vh;
	margin: 0;
	padding: 8px;
	background-color: #657AED;
	font-family: "Nunito", sans-serif;
}
.thanks {
	margin-top: 50px;
	color: #FFF;
	opacity: 0.5;
	font-size: 12px;
}
.thanks a {
	color: #FFF;
}
[data-reactroot] {
	flex-direction: column;
}
#progress {
	max-width: 400px;
	width: 100%;
	margin: 0 auto;
}
input {
	margin: 50px auto;
	display: block;
}
.progress-bar {
	width: 100%;
}
.progress-bar__bar {
	border-radius: 10px;
	background-color: #FFF;
	margin-bottom: 14px;
}
.progress-bar__progress {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	min-width: 15px;
	height: 10px;
	border-radius: 10px;
	background-color: #76E19E;
	transition: background-color 0.3s ease;
}
.progress-bar__progress--step-1 {
	background-color: #FB7593;
}
.progress-bar__progress--step-2 {
	background-color: #FFD05C;
}
.progress-bar__progress--step-3 {
	background-color: #76E19E;
}
.progress-bar__progress--step-completed {
	background-color: #76E19E;
}
.progress-bar__tick-wrapper {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	opacity: 0;
	background-color: #76E19E;
	transition: all 0.15s ease;
	transform: scale(0);
}
.progress-bar__progress--step-completed .progress-bar__tick-wrapper {
	opacity: 1;
	transform: scale(1);
}
.progress-bar__tick {
	width: 15px;
	height: 16px;
	fill: #FFF;
}
.progress-bar__label {
	display: block;
	font-size: rem(16);
	text-align: center;
	color: #FFF;
}
.progress-bar__label--left {
	text-align: left;
}
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
(function () {
    'use strict';
    var hasOwn = {}.hasOwnProperty;
    function classNames() {
        var classes = [];
        for (var i = 0; i < arguments.length; i++) {
            var arg = arguments[i];
            if (!arg) continue;
            var argType = typeof arg;
            if (argType === 'string' || argType === 'number') {
                classes.push(arg);
            } else if (Array.isArray(arg) && arg.length) {
                var inner = classNames.apply(null, arg);
                if (inner) {
                    classes.push(inner);
                }
            } else if (argType === 'object') {
                for (var key in arg) {
                    if (hasOwn.call(arg, key) && arg[key]) {
                        classes.push(key);
                    }
                }
            }
        }
        return classes.join(' ');
    }
    if (typeof module !== 'undefined' && module.exports) {
        classNames.default = classNames;
        module.exports = classNames;
    } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
        // register as 'classnames', consistent with npm package name
        define('classnames', [], function () {
            return classNames;
        });
    } else {
        window.classNames = classNames;
    }
})();
const ProgressBar = ({ className, progress, labelLeft }) => {
    let progressInt = parseInt(progress);
    const progressClassPrefix = `progress-bar__progress--step-`;
    const progressClassNames = {
        [`${progressClassPrefix}1`]: progressInt <= 25,
        [`${progressClassPrefix}2`]: progressInt > 25 && progressInt <= 50,
        [`${progressClassPrefix}3`]: progressInt > 50 && progressInt <= 99,
        [`${progressClassPrefix}completed`]: progressInt === 100
    };
    return /*#__PURE__*/(
        React.createElement("div", { className: classNames('progress-bar', className) }, /*#__PURE__*/
            React.createElement("div", { className: "progress-bar__bar" }, /*#__PURE__*/
                React.createElement("div", {
                    className: classNames('progress-bar__progress', progressClassNames),
                    style: { width: progress + '%' }
                }, /*#__PURE__*/
                    React.createElement("div", { className: "progress-bar__tick-wrapper" }, /*#__PURE__*/
                        React.createElement("svg", { className: "progress-bar__tick icon-tick", viewBox: "0 0 512 512" }, /*#__PURE__*/React.createElement("path", { d: "m135 280l97 97c20 20 20 52 0 72-20 20-53 20-73 0l-96-96c-20-20-20-53 0-73 20-20 52-20 72 0z m300-106c20 20 20 52 0 72l-193 193c-20 20-53 20-73 0-20-20-20-52 0-72l194-193c20-20 52-20 72 0z" }))))), /*#__PURE__*/
            React.createElement("span", { className: classNames('progress-bar__label', { 'progress-bar__label--left': labelLeft }) },
                progressInt === 0 ?
                    `No scenes completed` :
                    `${progress}% of scenes completed`)));
};
class CodepenProgressBar extends React.Component {
    constructor() {
        super(); _defineProperty(this, "onChange",
            e => {
                this.setState({
                    progress: e.currentTarget.value,
                    value: e.currentTarget.value
                });
            }); this.state = { progress: 50, value: 50 };
    }
    render() {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement(ProgressBar, { progress: this.state.progress }), /*#__PURE__*/
                React.createElement("input", { type: "range", value: this.state.value, onChange: this.onChange })));
    }
}
ReactDOM.render( /*#__PURE__*/
    React.createElement(CodepenProgressBar, null), document.getElementById('progress'));
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.4.0/umd/react.development.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.0/umd/react-dom.development.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.4.0/umd/react.development.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.0/umd/react-dom.development.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js'></script>
<style>
[data-reactroot], body {
	display: flex;
	align-items: center;
	justify-content: center;
}
* {
	box-sizing: border-box;
}
body {
	flex-direction: column;
	height: 100vh;
	margin: 0;
	padding: 8px;
	background-color: #657AED;
	font-family: "Nunito", sans-serif;
}
.thanks {
	margin-top: 50px;
	color: #FFF;
	opacity: 0.5;
	font-size: 12px;
}
.thanks a {
	color: #FFF;
}
[data-reactroot] {
	flex-direction: column;
}
#progress {
	max-width: 400px;
	width: 100%;
	margin: 0 auto;
}
input {
	margin: 50px auto;
	display: block;
}
.progress-bar {
	width: 100%;
}
.progress-bar__bar {
	border-radius: 10px;
	background-color: #FFF;
	margin-bottom: 14px;
}
.progress-bar__progress {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	min-width: 15px;
	height: 10px;
	border-radius: 10px;
	background-color: #76E19E;
	transition: background-color 0.3s ease;
}
.progress-bar__progress--step-1 {
	background-color: #FB7593;
}
.progress-bar__progress--step-2 {
	background-color: #FFD05C;
}
.progress-bar__progress--step-3 {
	background-color: #76E19E;
}
.progress-bar__progress--step-completed {
	background-color: #76E19E;
}
.progress-bar__tick-wrapper {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	opacity: 0;
	background-color: #76E19E;
	transition: all 0.15s ease;
	transform: scale(0);
}
.progress-bar__progress--step-completed .progress-bar__tick-wrapper {
	opacity: 1;
	transform: scale(1);
}
.progress-bar__tick {
	width: 15px;
	height: 16px;
	fill: #FFF;
}
.progress-bar__label {
	display: block;
	font-size: rem(16);
	text-align: center;
	color: #FFF;
}
.progress-bar__label--left {
	text-align: left;
}
</style>

</head>
<body>
<div id="progress"></div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
(function () {
    'use strict';
    var hasOwn = {}.hasOwnProperty;
    function classNames() {
        var classes = [];
        for (var i = 0; i < arguments.length; i++) {
            var arg = arguments[i];
            if (!arg) continue;
            var argType = typeof arg;
            if (argType === 'string' || argType === 'number') {
                classes.push(arg);
            } else if (Array.isArray(arg) && arg.length) {
                var inner = classNames.apply(null, arg);
                if (inner) {
                    classes.push(inner);
                }
            } else if (argType === 'object') {
                for (var key in arg) {
                    if (hasOwn.call(arg, key) && arg[key]) {
                        classes.push(key);
                    }
                }
            }
        }
        return classes.join(' ');
    }
    if (typeof module !== 'undefined' && module.exports) {
        classNames.default = classNames;
        module.exports = classNames;
    } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
        // register as 'classnames', consistent with npm package name
        define('classnames', [], function () {
            return classNames;
        });
    } else {
        window.classNames = classNames;
    }
})();
const ProgressBar = ({ className, progress, labelLeft }) => {
    let progressInt = parseInt(progress);
    const progressClassPrefix = `progress-bar__progress--step-`;
    const progressClassNames = {
        [`${progressClassPrefix}1`]: progressInt <= 25,
        [`${progressClassPrefix}2`]: progressInt > 25 && progressInt <= 50,
        [`${progressClassPrefix}3`]: progressInt > 50 && progressInt <= 99,
        [`${progressClassPrefix}completed`]: progressInt === 100
    };
    return /*#__PURE__*/(
        React.createElement("div", { className: classNames('progress-bar', className) }, /*#__PURE__*/
            React.createElement("div", { className: "progress-bar__bar" }, /*#__PURE__*/
                React.createElement("div", {
                    className: classNames('progress-bar__progress', progressClassNames),
                    style: { width: progress + '%' }
                }, /*#__PURE__*/
                    React.createElement("div", { className: "progress-bar__tick-wrapper" }, /*#__PURE__*/
                        React.createElement("svg", { className: "progress-bar__tick icon-tick", viewBox: "0 0 512 512" }, /*#__PURE__*/React.createElement("path", { d: "m135 280l97 97c20 20 20 52 0 72-20 20-53 20-73 0l-96-96c-20-20-20-53 0-73 20-20 52-20 72 0z m300-106c20 20 20 52 0 72l-193 193c-20 20-53 20-73 0-20-20-20-52 0-72l194-193c20-20 52-20 72 0z" }))))), /*#__PURE__*/
            React.createElement("span", { className: classNames('progress-bar__label', { 'progress-bar__label--left': labelLeft }) },
                progressInt === 0 ?
                    `No scenes completed` :
                    `${progress}% of scenes completed`)));
};
class CodepenProgressBar extends React.Component {
    constructor() {
        super(); _defineProperty(this, "onChange",
            e => {
                this.setState({
                    progress: e.currentTarget.value,
                    value: e.currentTarget.value
                });
            }); this.state = { progress: 50, value: 50 };
    }
    render() {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement(ProgressBar, { progress: this.state.progress }), /*#__PURE__*/
                React.createElement("input", { type: "range", value: this.state.value, onChange: this.onChange })));
    }
}
ReactDOM.render( /*#__PURE__*/
    React.createElement(CodepenProgressBar, null), document.getElementById('progress'));
</script>

</body>
</html>
Preview