Spinner

Spinners are used to indicate that a part of the product is loading or performing a task when the amount of time needed is unknown.

Spinner

Maven Central Class reference Source code

Default

Day Night
Spinner component Spinner component - dark mode

Installation

Backpack Compose is available through Maven Central. Check the main Readme for a complete installation guide.

Usage

Example of a Spinner:


                                                
                                                import net.skyscanner.backpack.compose.spinner.BpkSpinner
                                                import net.skyscanner.backpack.compose.spinner.BpkSpinnerSize
                                                
                                                BpkSpinner(
                                                  size = BpkSpinnerSize.Large,
                                                )

Example of a Spinner on dark surface:


                                                
                                                import net.skyscanner.backpack.compose.spinner.BpkSpinner
                                                import net.skyscanner.backpack.compose.spinner.BpkSpinnerSize
                                                import net.skyscanner.backpack.compose.spinner.BpkSpinnerStype
                                                
                                                BpkSpinner(
                                                  size = BpkSpinnerSize.Large,
                                                  style = BpkSpinnerStyle.OnDarkSurface,
                                                )

When style is not specified, the Spinner sets it based on LocalContentColor. When color is more close to white, and it's in light mode BpkSpinnerStyle.OnDarkSurface will be used – otherwise it falls back to BpkSpinnerStyle.TextPrimary.