Close
Angular React Web Components Blazor
Open Source

Blazor Linear Progress Overview

The Ignite UI for Blazor Linear Progress Indicator component provides a visual indicator of an application’s process as it changes. The IgbLinearProgress indicator updates its appearance as its state changes. Also, you can style this component with a choice of colors in stripes or solids.

Blazor Linear Progress Example

Usage

Before using the IgbLinearProgress, you need to register it as follows:

// in Program.cs file

builder.Services.AddIgniteUIBlazor(typeof(IgbLinearProgressModule));

You will also need to link an additional CSS file to apply the styling to the IgbCalendar component. The following needs to be placed in the wwwroot/index.html file in a Blazor Web Assembly project or the Pages/_Host.cshtml file in a Blazor Server project:

<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />

The simplest way to start using the IgbLinearProgress is as follows:

<IgbLinearProgress Value=100 />

Progress Types

You can set the type of your indicator, using the Variant attribute. There are five types of linear progress indicators - primary (default), error, success, info, and warning.

<IgbLinearProgress Value=100 Variant=@ProgressBaseVariant.Success />

Striped Progress

You can make the indicator striped, using the Striped property:

Indeterminate Progress

If you want to track a process that is not determined precisely, you can set the Indeterminate property.

Animation Duration

The AnimationDuration property is used to specify how long the animation cycle should take. It takes as value a number which represents the animation duration in milliseconds.

<IgbLinearProgress AnimationDuration=5000 Indeterminate=true />

Text Properties

You can align the default value, using the LabelAlign property. Permitted values are top, bottom, top-start, top-end, bottom-start and bottom-end.

To hide the default label of the progress indicator, use the HideLabel attribute.

The LabelFormat property can be used to customize the IgbLinearProgress default label.

The following sample demonstrates the above configuration:

Dynamic Progress

You can dynamically change the value of the progress indicator by using external controls like buttons. To achieve this, we can bind the value to a class property:

Styling

The IgbLinearProgress component exposes CSS parts for almost all of its inner elements:

NameDescription
trackThe progress ring’s track area.
fillThe progress indicator area.
stripedThe progress striped indicator.
labelThe progress indicator label.
valueThe progress label value.
indeterminateThe progress indeterminate state.
primaryThe progress indicator primary state.
dangerThe progress indicator error state.
warningThe progress indicator warning state.
infoThe progress indicator info state.
successThe progress indicator success state.

Using this CSS parts we have almost full control of the Linear Progress styling.

igc-linear-progress::part(track){
  background-color: var(--ig-gray-300)
}

igc-linear-progress::part(fill){
  background-color: var(--ig-primary-300)
}

igc-linear-progress::part(label){
  color: var(--ig-primary-300)
}

API References

Additional Resources