Class LinearProgress
A progress indicator that displays progress linearly along a horizontal bar.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class LinearProgress : Progress, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder, ISizeableElement
Remarks
Linear Progress indicators express an unspecified wait time or display the length of a process. They help users visualize the progression of an operation or activity in your application.
The component supports two variants: determinate and indeterminate. Use determinate progress indicators when the wait time or completion percentage is known. For operations where the wait time is unknown, use the indeterminate mode which displays a continuous animation.
Note: Progress indicators inform users about the status of ongoing processes, such as loading an app, submitting a form, or saving updates.
The LinearProgress component inherits from the base Progress class and implements additional features specific to linear representation of progress.
Examples
Basic indeterminate progress: Shows an animated progress bar for operations with unknown duration
<LinearProgress variant="Indeterminate" />
Determinate progress with buffer: Shows a progress bar with both primary and buffer progress, useful for media playback scenarios
<LinearProgress
variant="Determinate"
value="0.4"
bufferValue="0.6"
size="M"
roundedProgressCorners="true"
/>
Programmatic usage example: Creating and configuring a progress bar through code
var progress = new LinearProgress();
progress.variant = Variant.Determinate;
progress.value = 0.75f;
progress.size = Size.L;
progress.colorOverride = new Color(0.2f, 0.6f, 1f, 1f);
Styling with USS: Customizing the appearance using USS styles
.custom-progress {
--progress-color: rgb(25, 118, 210);
width: 200px;
margin: 8px;
}
Constructors
LinearProgress()
Default constructor.
Declaration
public LinearProgress()
Fields
ussClassName
The Progress main styling class.
Declaration
public const string ussClassName = "appui-linear-progress"
Field Value
| Type | Description |
|---|---|
| string |
Methods
GenerateTextures()
Generates the textures for the progress element.
Declaration
protected override void GenerateTextures()