Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
Data displayAndroid

Animated number

Count a formatted number up, or roll odometer reels, the first time it appears.

Public APILumenAnimatedNumberAndroid / Compose

Native example

Use Animated number

Use it for headline metrics. Keep the final value meaningful on its own, because reduced motion shows it at once.

Animated number rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
@Composable
fun UsageFigures(revenue: Double, requests: Long) {
    val figure = TextStyle(fontSize = 32.sp, fontWeight = FontWeight.SemiBold)
    Column(verticalArrangement = Arrangement.spacedBy(LumenSpacing.Md)) {
        LumenText("Monthly revenue", variant = LumenTextVariant.Caption, tone = LumenTextTone.Muted)
        LumenAnimatedNumber(value = revenue, prefix = "$", style = figure)
        LumenText("API requests", variant = LumenTextVariant.Caption, tone = LumenTextTone.Muted)
        LumenAnimatedNumber(
            value = requests.toDouble(),
            variant = LumenAnimatedNumberVariant.Odometer,
            style = figure
        )
    }
}
Android
A revenue figure that counts up and a request total that rolls each digit on an odometer reel, both easing from the shown value when the data changes.

Reference

Public API

The primary shared and platform-specific options exposed by LumenAnimatedNumber.

APIValues or typeDefaultDescription
value / variant / durationfinal number / count or odometer / motion lengthrequired / count / slow (count), scene (odometer)Use it for headline metrics.

Native behavior

Design and accessibility

When to use it

Use it for headline metrics. Keep the final value meaningful on its own, because reduced motion shows it at once.

Accessibility

Assistive technology reads only the final formatted value.

Shared component

Available on other platforms

React NativeApple / SwiftUI Web
Android docsCompose module