×

Ionic progress bar

The ionic progress bar element is a horizontal progress bar used to visualize the progression of operation and activity. You can use the <ion-progress-bar> component to create a progress bar in the ionic application.

There are two types of the ionic progress bar, which are as follows:

  • Determinate
  • Indeterminate

Determinate

When the percentage of operation is known, then you should use the determinate type. It is the default type of progress bar, and also value property represents the progress bar.

Example: This example explains how you can use the determinate progress bar in the ionic application.

Home.page.html

<ion-header>  
   <ion-toolbar color="primary">  
     <ion-title>Ionic Progress Bar</ion-title>  
   </ion-toolbar>  
 </ion-header>   
 <ion-content class="ion-padding" color="light">  
 <p>Default Progress Bar</p>  
 <ion-progress-bar></ion-progress-bar>   
 <p>Default Progress Bar at 60%</p>  
 <ion-progress-bar value="0.6"></ion-progress-bar>  
 </ion-content>   

Output: After executing this code you will get the output, which shown below:

Ionic progress bar

Indeterminate

It is a type of progress bar, which shows operation in progress. This means there is no requirement to indicate how long it will take time. If you add the reversed=“true” property, then you receive a query that is used to specify the pre-loading.

Example: The following example is used to explain how you can use the indeterminate progress bar in the ionic application.

Home.page.html

<ion-header>  
   <ion-toolbar color="primary">  
     <ion-title>Ionic Progress Bar</ion-title>  
   </ion-toolbar>  
 </ion-header>  
 <ion-content class="ion-padding" color="light">   
 <p>Indeterminate Progress Bar</p>  
 <ion-progress-bar type="indeterminate"></ion-progress-bar>     
 <p>Indeterminate Reversed</p>
 <ion-progress-bar type="indeterminate" reversed="true"></ion-progress-bar>  
 </ion-content>   

Output: After executing this code you will get the output, which shown below:

Ionic progress bar2

Buffer

The buffer displays the circle as an animation to specify some activity in the ionic application. If the buffer property value is less than one, the additional buffering progress can be shown.

Example: This example is used to explain how you can use the buffer attribute in the progress bar.

Home.page.html

<ion-header>  
   <ion-toolbar color="primary">  
     <ion-title>Ionic Progress Bar</ion-title>  
   </ion-toolbar>  
 </ion-header>     
 <ion-content class="ion-padding" color="light">  
 <p>Buffer Progress Bar</p>  
 <ion-progress-bar value="0.35" buffer="0.5"></ion-progress-bar>     
 <p>Progress Bar</p> 
 <ion-progress-bar value="0.20"></ion-progress-bar>  
 </ion-content>   

Output: After executing this code you will get the output, which is shown below:

Ionic progress bar3

Colorization of the Progress bar

You can use the <ion-progress-bar> component to configure the color in the progress bar. Here, you can add the different colors in the ionic progress bar.

Example: This example is used to explain how you can use the color property in the ionic progress bar.

Home.page.html

<ion-header>  
 <ion-progress-bar value="0.20"></ion-progress-bar>  
 </ion-content>   
   <ion-toolbar color="primary">  
     <ion-title>Ionic Progress Bar</ion-title>  
   </ion-toolbar>  
 </ion-header>   
 <ion-content class="ion-padding" color="light">  
 <p>Colorize Progress Bar</p>  
 <ion-progress-bar value="0.35" color="danger"></ion-progress-bar><br>     
 <ion-progress-bar value="0.20" color="success"></ion-progress-bar><br>
 <ion-progress-bar value="0.50" color="primary"></ion-progress-bar><br>
 <ion-progress-bar value="0.40" color="warning"></ion-progress-bar><br>
 <ion-progress-bar value="0.60" color="tertiary"></ion-progress-bar>
 </ion-content>   

Output: After executing this code you will get the output, which is shown below:

Ionic progress bar4

Bind a variable with Progress Bar

You can also bind the progress bar with the value in the ionic application. For doing this, you required to add the value in square brackets, which calls the variable that binds to this value property.

Example: This example is used to explain how you can bind a variable with the progress bar.

Home.page.html

<ion-header>  
   <ion-toolbar color="primary">  
     <ion-title>Ionic Progress Bar</ion-title>  
   </ion-toolbar>  
 </ion-header> 
 <ion-content class="ion-padding" color="light">  
 <p>Bind a variable</p>  
 <ion-progress-bar [value]="progress" color="danger"></ion-progress-bar>     
 </ion-content>  

Home.page.ts   

In the home.page.ts file, you can set the time interval to load the progress bar.

import { Component } from
'@angular/core';  
 @Component({  
   selector: 'app-home',  
   templateUrl: 'home.page.html',  
   styleUrls: ['home.page.scss'],  
 })  
 export class HomePage {  
   progress = 0.20;   
   constructor() {  
     setInterval( () => {  
       this.progress += .1;  
       }, 1000 );  
   }  
 }   

Output: After executing this code you will get the output, which is shown below:

Ionic progress bar5

When the time interval is completed then it shows something like this.

Ionic progress bar6

Related Topics

Ionic Navigation and Routing

The latest version (ionic 4) of the ionic framework, no longer limited to the angular. In Ionic 4, you can create an ionic project in different front-end frameworks such as Vue.js, React.js, and...

6 minutes read.

Ionic Select

The Ion Selection component is similar to the HTML <select> element. However, the Ionic Selection component makes it easy for users to categorize and choose the preferred option or other options. You must...

3 minutes read.

Ionic Contents

Ionic Contents The content component provides an easy-to-use content area with some useful ways to control the scrollable region. There should be only one content in one view. Content, along with several other Ionic...

2 minutes read.

Ionic Popover

The Ionic popover is a small dialog box that displays at the top of the screen. It can be used for anything, but it is usually used for a button, an action,...

4 minutes read.

Ionic Tutorial for Beginners

What is Ionic? Ionic is an open-source framework that is used for the development of mobile applications. It is also used to build android applications, iOS, applications, desktop applications, and web applications using web...

4 minutes read.

Ionic Buttons

Ionic Buttons There are different types of buttons in the Ionic framework. These buttons are subtly animated, enhancing the user experience when using the application. Buttons are a fundamental way of interacting and navigating...

4 minutes read.

Ionic Chip

Ionic chip displays the complex entities in small entities in small blocks, such as the contacts. Ionic chip has several types of elements like avatars, thumbnails, text, and icons. It is a bubble-like...

3 minutes read.

Ionic Loading

The ionic loader is an overlay that can be used to indicate activity, the user interaction while blocking. The ionic loader shows on the top of the app content, and it can...

5 minutes read.

Ionic vs React Native

Ionic Vs React Native Ionic and React Native are both common framework which is used to develop mobile applications. Here, you will know about the popular differences between the ionic and the React Native. Ionic Ionic...

3 minutes read.

History of Ionic

It is a complete open-source platform for hybrid mobile application development created by Ben Sperry, Max Lynch, and Adam Bradley of Drifty Co. in 2013. The first alpha version of the framework was...

2 minutes read.

Ionic vs Apache Cordova

Ionic Vs Apache Cordova Ionic and Cordova are two popular technology going on in the market for mobile application development. The combination of these two technologies creates a development platform that is known as...

3 minutes read.

Ionic Menu

The Ionic menu is the side-menu navigation that can be slide in from the side of the current view. By default, the menu slides in from the left side, but the side...

7 minutes read.

Ionic List

Ionic List The ionic list is created of several rows of items that can contain text, buttons, thumbnails, keys, icons, and more. Lists are one of the essential components in any web or...

4 minutes read.

Ionic Splash Screen

The Apache Cordova plugin helps to displays and hides a splash screen during the application launch. The Ionic Splash Screen is similar to a home page on a website. The ionic splash...

2 minutes read.

Ionic Geolocation

In today’s time, the mobile location plays an essential role in the mobile application. The Ionic Cordova geolocation plugin provides information about the location of the device, like as latitude and longitude. The...

5 minutes read.

Ionic Actionsheet

Ionic Actionsheet The Action sheet is a dialog box that displays a group of options. It is shown on the top of the application content and must be dismissed manually before the user can resume...

3 minutes read.

Ionic Reorder

The Ionic offers the <ion-reorder> component to reordering features. Ionic reorder component adds the Drag and Drop feature to list items, in which the user can change the order of the items. Reorder...

3 minutes read.

Ionic Cards

Ionic Cards: Ionic cards are a standard part of the user interface that acts as an entry point for more specific information. These are the best components for displaying information...

4 minutes read.

Ionic Radio

Ionic Radio The radio button is the type of input component that has a Boolean value. The Ionic radio button has a different pattern on every platform, as well as other Ionic components....

2 minutes read.

Features of Ionic Framework

The Ionic Framework is based on the AngularJS framework that permits a programmer to use a combination of many other programming languages, like HTML5, CSS, and JavaScript. Some of the...

4 minutes read.