Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
Data displayApple

Animated number

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

Public APILumenAnimatedNumberApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

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 iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
import LumenUI
import SwiftUI

struct RevenueMetrics: View {
    var body: some View {
        HStack(spacing: LumenSpacing.xl) {
            VStack(alignment: .leading, spacing: LumenSpacing.xs) {
                LumenText("Monthly revenue", variant: .caption, tone: .muted)
                LumenAnimatedNumber(48_250, prefix: "$")
                    .font(.title.weight(.semibold))
            }
            VStack(alignment: .leading, spacing: LumenSpacing.xs) {
                LumenText("Shipping since", variant: .caption, tone: .muted)
                LumenAnimatedNumber(2014, grouping: false, variant: .odometer)
                    .font(.title.weight(.semibold))
            }
        }
    }
}
Apple
Two dashboard metrics: a revenue figure that counts up from zero and a founding year that rolls in on odometer reels.

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 NativeAndroid / Compose Web
Apple docsSwiftUI package