Skip to main content

Progress Indicators

Show loading or progress state with native and Drift-rendered indicators.

ActivityIndicator

Native platform spinner (UIActivityIndicatorView on iOS, ProgressBar on Android).

widgets.ActivityIndicator{
Animating: true,
Size: widgets.ActivityIndicatorSizeMedium, // Small, Medium, Large
Color: colors.Primary, // Optional
}

ActivityIndicator Properties

PropertyTypeDescription
AnimatingboolWhether the spinner is active
SizeActivityIndicatorSizeSmall, Medium, or Large
Colorgraphics.ColorOptional tint color

CircularProgressIndicator

Drift-rendered circular progress. Set Value to nil for indeterminate animation.

// Themed (recommended)
theme.CircularProgressIndicatorOf(ctx, nil) // indeterminate
theme.CircularProgressIndicatorOf(ctx, &progress) // determinate

// Explicit (full control)
widgets.CircularProgressIndicator{
Value: nil,
Size: 36,
Color: colors.Primary,
TrackColor: colors.SurfaceVariant,
StrokeWidth: 4,
}

CircularProgressIndicator Properties

PropertyTypeDescription
Value*float64Progress 0.0 to 1.0, nil for indeterminate
Sizefloat64Diameter in pixels
Colorgraphics.ColorProgress arc color
TrackColorgraphics.ColorBackground track color
StrokeWidthfloat64Arc thickness

LinearProgressIndicator

Drift-rendered linear progress bar. Set Value to nil for indeterminate animation.

// Themed (recommended)
theme.LinearProgressIndicatorOf(ctx, nil) // indeterminate
theme.LinearProgressIndicatorOf(ctx, &progress) // determinate

// Explicit (full control)
widgets.LinearProgressIndicator{
Value: nil,
Color: colors.Primary,
TrackColor: colors.SurfaceVariant,
Height: 4,
BorderRadius: 2,
}

LinearProgressIndicator Properties

PropertyTypeDescription
Value*float64Progress 0.0 to 1.0, nil for indeterminate
Colorgraphics.ColorProgress bar color
TrackColorgraphics.ColorBackground track color
Heightfloat64Bar height
BorderRadiusfloat64Corner radius