Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
Data displayReact Native

Animated number

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

Public APILumenAnimatedNumberReact Native

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 Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Animated number demo
tsx
import { LumenAnimatedNumber, LumenCard, LumenText } from '@santi020k/lumen-react-native'

export const DeploySuccess = ({ rate }: { rate: number }) => (
  <LumenCard padding="lg">
    <LumenText tone="muted" variant="caption">
      Deploy success
    </LumenText>
    <LumenAnimatedNumber decimals={1} suffix="%" textVariant="title" value={rate} />
    <LumenAnimatedNumber grouping={false} value={2014} variant="odometer" />
  </LumenCard>
)
React Native
Counts a formatted metric up, or rolls odometer reels, while assistive technology reads only the final value.

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

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives