Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
FeedbackReact Native

Timer

Display absolute-clock countdowns and elapsed time with controlled announcement frequency.

Public APILumenTimerReact Native

Native example

Use Timer

Keep the target instant in host state. Backgrounding pauses updates while absolute time continues. Invalid targets show a placeholder; countdowns stop at zero and report completion once after running. The timer uses no animation.

Timer rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Timer demo
tsx
const [deadline] = useState(() => Date.now() + 65_000)
return <LumenTimer label="Time remaining" to={deadline}
  units={['minutes', 'seconds']} announce="complete"
  completeLabel="Countdown finished" />

Reference

Public API

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

APIValues or typeDefaultDescription
labelLocalized stringRequiredNames the timer independently of its changing digits.
modecountdown · elapsedcountdownCounts toward to or from the elapsed start.
to / fromDate | number | stringAbsentSupplies an absolute instant. Missing or invalid targets show --:--.
formatclock · unitsclockSelects a clock or localized duration units.
unitsdays · hours · minutes · secondsCountdown: all; elapsed: hours/minutes/secondsThe largest selected unit absorbs larger values.
announceoff · complete · minuteoffLimits polite announcements to completion or minute changes.
completeLabelStringTimer completeApplication-localized completion copy.
onCompleteOptional callbackAbsentReports one running-to-complete transition per target; an already-expired target is silent.

Native behavior

Design and accessibility

When to use it

Keep the target instant in host state. Backgrounding pauses updates while absolute time continues. Invalid targets show a placeholder; countdowns stop at zero and report completion once after running. The timer uses no animation.

Accessibility

One named timer exposes its current value. Ticking digits are not a live region; opt into polite completion or minute announcements.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives