Package-level declarations

Progress Indicators express an unspecified wait time or display the duration of a process.

Spark provides three distinct composables for progress indication:

CircularProgressIndicator

A circular progress indicator that displays the exact progress of a process.

var progress by remember { mutableFloatStateOf(0.5f) }

CircularProgressIndicator(
progress = { progress }
)

LinearProgressIndicator

A linear progress indicator that displays the exact progress of a process along a horizontal line.

var progress by remember { mutableFloatStateOf(0.5f) }

LinearProgressIndicator(
progress = { progress },
modifier = Modifier.fillMaxWidth(),
)

LinearProgressIndicatorIndeterminate

A linear progress indicator that expresses an unspecified wait time. It continuously animates along a horizontal line.

LinearProgressIndicatorIndeterminate(
modifier = Modifier.fillMaxWidth(),
)

Spinners express an unspecified amount of wait time. They should be used when progress isn't detectable, or if it's not necessary to indicate how long an activity will take.

Intents

A visible background may be added to display a background behind the spinner.

All intents from Spark are available for this component (SpinnerIntent).

  • Support

  • Accent

  • Main

  • Surface

  • Success

  • Alert

  • Danger

  • Info

  • Neutral

  • Current (default)

The spinner has two sizes (SpinnerSize):

  • Small (20.dp)

  • Medium (28.dp)

Usage Example

Spinner(intent = SpinnerIntent.Main)
Spinner(intent = SpinnerIntent.Current, size = SpinnerSize.Small)

Types

Link copied to clipboard

Contains the default values used for LinearProgressIndicator and CircularProgressIndicator.

Link copied to clipboard
Link copied to clipboard

SpinnerIntent is used to define the intent of the spinner.

Link copied to clipboard

Functions

Link copied to clipboard
fun CircularProgressIndicator(@FloatRange(from = 0.0, to = 1.0) progress: () -> Float, modifier: Modifier = Modifier)

Progress indicators express an unspecified wait time or display the duration of a process.

Link copied to clipboard
fun LinearProgressIndicator(progress: () -> Float, modifier: Modifier = Modifier)

Progress indicators express an unspecified wait time or display the duration of a process.

Link copied to clipboard

Progress indicators express an unspecified wait time or display the duration of a process.

Link copied to clipboard
fun Spinner(modifier: Modifier = Modifier, intent: SpinnerIntent = SpinnerIntent.Current, size: SpinnerSize = SpinnerDefaults.Size)

Spinners provide a visual clue that an action is processing awaiting a course of change or a result.