Skip to content

Loading ​

A loading indicator with a spinning ring animation. The duration comes from motion.duration.base (in milliseconds).

Spec source: lh-ui-core/specs/loading.json · Golden cases: cases/loading.json (8 cases: 5 token mappings translated into JVM unit tests, 3 label semantics asserted in androidTest)

Size and tone ​

Three sizes map to the loading.size.* tokens, the stroke width comes from loading.strokeWidth, and tones take semantic colors.

9:41Loading
Loading…

HTML mock preview (Android / Compose look), not an on-device render

kotlin
LhLoading(lhSize = LhLoadingSize.large, tone = LhLoadingTone.primary)

Loading label ​

text falls back to the locale pack when omitted (default "Loading…"); an explicit label takes precedence; an empty string renders the spinner only.

kotlin
LhLoading(text = "Syncing")

API ​

Props ​

PropDescriptionTypeDefault
lhSizeIndicator diameterLhLoadingSizeMedium
toneRing colorLhLoadingTonePrimary
textLoading label; falls back to the locale pack when omitted, empty string renders the spinner onlyString?@lh-i18n
modifierModifierModifierModifier

LhLoadingSize ​

ValueSize token
Smallloading.size.small (16dp)
Mediumloading.size.medium (20dp)
Largeloading.size.large (24dp)

LhLoadingTone ​

ValueColor token
Primarycolor.primary.default
Successcolor.success.default
Warningcolor.warning.default
Dangercolor.danger.default
Infocolor.info.default

Token reference ​

TokenUsage
loading.size.{small,medium,large}Three diameters
loading.strokeWidthRing stroke width
typography.fontSize.small / color.text.secondaryLabel font size and color
color.{primary,success,warning,danger,info}.defaultSemantic tones
motion.duration.baseDuration of one full rotation (an integer number of milliseconds on the client)

Golden case reference ​

case idAssertionLocal test
medium-size-uses-medium-tokenMedium takes the medium size tokenLhLoadingDefaultsTest.medium_size_uses_medium_token
large-size-uses-large-tokenLarge takes the large size tokenLhLoadingDefaultsTest.large_size_uses_large_token
primary-tone-uses-primary-tokenThe primary tone takes the primary tokenLhLoadingDefaultsTest.primary_tone_uses_primary_token
success-tone-uses-success-tokenThe success tone takes the success tokenLhLoadingDefaultsTest.success_tone_uses_success_token
render-emits-ring-commandThe ring indicator renders (the stroke width consumes a token)LhLoadingDefaultsTest.stroke_width_uses_token
text-fallback-localeAn omitted label falls back to the locale pack (default "Loading…")LhLoadingTest.text_fallback_to_locale
text-explicit-winsAn explicit label takes precedence over the locale packLhLoadingTest.explicit_text_wins_over_locale
text-empty-spinner-onlyAn empty string renders the spinner onlyLhLoadingTest.empty_text_renders_spinner_only
bash
./gradlew :components:loading:test                          # JVM part (token mappings)
./gradlew :components:loading:connectedAndroidTest          # Instrumented part (label semantics; requires a device)

lh-ui native bloodline · Android (Kotlin + Compose)