Skip to content

Spinner ​

An activity spinner — a continuously rotating accent-colored ring indicating indeterminate progress, in three sizes. label is the accessible status text; set showLabel to render it beside the ring (otherwise it stays in semantics only).

Import ​

kotlin
import io.github.heartcoolman.prism.ui.PrismSpinner

Basic usage ​

kotlin
PrismSpinner()

Sizes ​

kotlin
PrismSpinner(size = PrismSpinnerSize.Sm)
PrismSpinner(size = PrismSpinnerSize.Md)
PrismSpinner(size = PrismSpinnerSize.Lg)

Visible label and custom color ​

kotlin
PrismSpinner(
    label = "Loading projects",
    showLabel = true,
    color = PrismTheme.colors.accent,
)

API ​

ParameterTypeDefaultDescription
modifierModifierModifierLayout/visual modifier.
sizePrismSpinnerSizePrismSpinnerSize.MdRing diameter: Sm (16dp), Md (24dp), Lg (36dp).
colorColorPrismTheme.colors.accentRing color.
labelString"加载中"Accessible status text; also the visible caption when showLabel is true.
showLabelBooleanfalseRender the label beside the ring instead of semantics-only.

Enum ​

kotlin
enum class PrismSpinnerSize { Sm, Md, Lg }

All components assume an enclosing PrismTheme { }. See Styling for theming details.

Released under the MIT License.