Open In App

How to create animated progress bar using react-bootstrap ?

Last Updated : 30 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

A progress bar is used to display the progress of a process on a computer. A progress bar displays how much of the process is completed and how much is left. You can add a progress bar on a web page using

  • ProgressBar from ‘react-bootstrap/ProgressBar
  • Predefined bootstrap classes.:

Here in this article, we will learn to build a progress bar in React using Bootstrap classes

Prerequisites:

Steps to Create the React Application And Installing Module:

Step 1: Create a react application using the following command  

npx create-react-app foldername

Step 2: Once it is done change your directory to the newly created application using the following command  

cd foldername

Step 3: Install Bootstrap dependency

npm install bootstrap

Project Structure:

The updated dependencies in package.json file will look like:

"dependencies": {
"bootstrap": "^5.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4",
}

Example: Now write down the following code in the App.js file

Javascript




import Progress from "./Progress";
function App() {
    return (
        <div className="App">
            <Progress />
        </div>
    );
}
 
export default App;


Javascript




import React from "react";
import ProgressBar from 'react-bootstrap/ProgressBar'
function Progress() {
    return (
        <div>
            <h1 style={{ color: 'green' }}>
                <center>GeeksforGeeks</center>
            </h1>
 
            <div class="container">
                <div className="progress-bar bg-primary
                            progress-bar-striped
                            progress-bar-animated"
                    style={{ width: '50%' }}>50%</div>
                <br></br>
                <div className="progress-bar bg-success
                            progress-bar-striped
                            progress-bar-animated"
                    style={{ width: '90%' }}>90%</div>
                <br></br>
                <div className="progress-bar bg-warning
                            progress-bar-striped
                            progress-bar-animated"
                    style={{ width: '30%' }}>30%</div>
                <br></br>
                <div className="progress-bar bg-danger
                            progress-bar-striped
                            progress-bar-animated"
                    style={{ width: '10%' }}>10%</div>
                <br></br>
                <div className="progress-bar bg-info
                            progress-bar-striped
                            progress-bar-animated"
                    style={{ width: '70%' }}>70%</div>
            </div>
        </div>
    )
}
 
export default Progress;


Step to Run the application: Enter the following command to run the application.

npm start

Output:



Similar Reads

Bootstrap 5 Progress Animated stripes
Bootstrap 5 Progress Animated stripes are used to make the stripes progress bar animated. To make a progress bar you need to use the Progress bar classes and to make it striped use the Progress Bar Striped classes. Pre-requisite: Bootstrap 5 Progress and Bootstrap 5 Striped Progress Bars. Bootstrap 5 Progress Animated stripes Class: progress-bar-an
2 min read
How to create multi step progress bar using Bootstrap ?
In this article, we will create a multi-step progress bar using Bootstrap. In addition to Bootstrap, we will use jQuery for DOM manipulation. Progress bars are used to visualize the quantity of work that's been completed. The strength of the progress bar indicates the progress of the work. It is generally used in online web apps like YouTube, GitHu
4 min read
How to create a stacked progress bar using Bootstrap 5 ?
In this article, we will know how to create the stacked progress bar with the label on it using Bootstrap. Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. A Progress bar is used to display the progress of a process on a computer. A progress bar displays how much of the process is com
3 min read
How to create a progress bar using bootstrap ?
Bootstrap is an open-source framework used to design responsive websites which is easy and efficient to use. It has ready-made templates which can be used to design web pages in a limited time. What is a progress bar? A progress bar is used whenever there is a need for a visual interface to show progress in a particular task. Let's say, "How much p
4 min read
How to add a Progress Bar in react-native using react-native-paper library ?
React native is a framework developed by Facebook for creating native-style apps for iOS &amp; Android under one common language, JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now render mobile UI's for both platforms. Approach: In this a
3 min read
How to create a progress bar in different colors in Bootstrap ?
Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. The progress bar is a pictorial representation that tells about the details of any goal or task i.e. it is used to represent the progress of a task or any operation that displays how much of the process is completed and how much is left
3 min read
How to Create Animated Navigation Bar with Hover Effect using HTML and CSS ?
The Navigation bar or navbar or menu-bar is the most important component of any web or mobile application. The user can only navigate from one page to another page through this menu. It is usually provided at the top of the website to provide a better UX (user experience). Approach: The approach is to create a navbar first and then animate a line b
3 min read
How to create a custom progress bar component in React.js ?
A Progress Bar shows the measure of progress of any task or activity Linearly. It is the graphical representation of linear progression. We can make a custom reusable Progress bar component using React.js Prerequisites: NPM &amp; Node.jsReact JSBasic Knowledge of HTML/CSSInline styling in ReactApproach:To create a custom progress bar component in R
3 min read
How to create progress bar in React JS ?
A progress bar shows the measure of progress of any task or activity. It is the graphical representation of progression. Material UI for React has this component available for us and is very easy to integrate. We can Create a straightforward Progress Bar in React JS using the following approach. Prerequisites:NodeJS or NPMReact JSSteps to Create th
2 min read
How to do box shadow with progress bar style using bootstrap?
Progress bars are used to show the progress of a process. Box shadow with progress bar style highlights the user progress of a task/process with box-shadow effect. Syntax: &lt;td style="box-shadow: px px px px rgba()"&gt;&lt;/td&gt; Return Value: It returns box shadow with progress bar style. Example 1: &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en
2 min read