Number Flow React Native
Components

TimeFlow

View-based animated time display component (HH:MM:SS)

TimeFlow renders animated time displays with independently rolling hours, minutes, and seconds segments. It supports 12-hour and 24-hour formats, optional segments, countdown modes, and timestamp-based input.

Import

import { TimeFlow } from 'number-flow-react-native';

Basic Usage

A live clock that updates every second:

Props

Time value props

PropTypeDefaultDescription
hoursnumber (0–23)undefinedHours value. Omit to hide the hours segment (useful for MM:SS countdown mode).
minutesnumber (0–59)(required)Minutes value.
secondsnumber (0–59)undefinedSeconds value. Omit to hide the seconds segment.
centisecondsnumber (0–99)undefinedCentiseconds value. Omit to hide. Requires seconds to be set. Displayed as ".CC" after seconds.
timestampnumberundefinedUnix timestamp in milliseconds. Auto-extracts hours/minutes/seconds. Takes priority over direct value props.
timezoneOffsetnumberundefinedTimezone offset in milliseconds for timestamp mode.

Format props

PropTypeDefaultDescription
is24HourbooleantrueUse 24-hour format. When false, displays 12-hour format. Only applies when hours are shown.
padHoursbooleantruePad hours with a leading zero ("09:30" vs "9:30").

Style props

PropTypeDefaultDescription
styleTextStyleundefinedText styling. fontSize defaults to 16 when omitted. textAlign defaults to "left".
containerStyleViewStyleundefinedStyle applied to the outer container View.

Animation behavior props

All props from AnimationBehaviorProps are supported: trend, animated, respectMotionPreference, continuous, mask, transformTiming, spinTiming, opacityTiming, onAnimationsStart, onAnimationsFinish. See NumberFlow for details.

Examples

Countdown timer (MM:SS)

Omit hours to show minutes and seconds only:

import { useEffect, useState } from 'react';
import { View } from 'react-native';
import { TimeFlow } from 'number-flow-react-native';

function CountdownTimer({ initialSeconds = 300 }) {
  const [remaining, setRemaining] = useState(initialSeconds);

  useEffect(() => {
    if (remaining <= 0) return;
    const interval = setInterval(() => {
      setRemaining(prev => Math.max(0, prev - 1));
    }, 1000);
    return () => clearInterval(interval);
  }, [remaining]);

  const mins = Math.floor(remaining / 60);
  const secs = remaining % 60;

  return (
    <View style={{ alignItems: 'center', padding: 24 }}>
      <TimeFlow
        minutes={mins}
        seconds={secs}
        style={{ fontSize: 64, fontWeight: '700', color: '#e53e3e' }}
        trend={-1}
      />
    </View>
  );
}

12-hour format

<TimeFlow
  hours={14}
  minutes={30}
  seconds={0}
  is24Hour={false}
  padHours={false}
  style={{ fontSize: 36, color: '#333' }}
/>
{/* Renders: 2:30:00 */}

Timestamp with timezone offset

const tokyoOffset = 9 * 60 * 60 * 1000; // UTC+9 in ms

<TimeFlow
  timestamp={Date.now()}
  timezoneOffset={tokyoOffset}
  style={{ fontSize: 32, color: '#1a1a1a' }}
/>

Accessibility

TimeFlow sets accessibilityRole="text" and an accessibilityLabel with the full formatted time string automatically. Screen readers read the complete time (e.g. "14:30:00") rather than announcing individual digit changes.

On this page