Skip to content
Native Animation
Rolling Temperature Stepper animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add rolling-temperature-stepper
StepperThermostat

Rolling Temperature Stepper

React Native Animated Counter Stepper

A thermostat stepper with rolling digits and temperature-linked color washes, with configurable bounds, warm color, and font.

$9 for this animation

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this animation

A React Native animated counter should make value changes legible instead of moving every digit at once. This thermostat stepper splits the formatted number into right-aligned character windows and rolls only the characters that change, even when a new update interrupts the previous one. Use it for temperature, quantity, score, duration, or other bounded numeric settings that benefit from tactile plus and minus controls. Reanimated shared values coordinate each roller, the warm-to-cool surface tint, press feedback, and motion echoes without per-frame React state. Expo Linear Gradient adds material depth. The component supports controlled and uncontrolled values, custom limits and steps, press-and-hold repeat, colors, fonts, units, callbacks, and imperative increment, decrement, and setValue methods.

When to use it

  • Adjust a thermostat or climate setting.
  • Step through bounded quantities or scores.
  • Show an odometer-style changing value.
  • Add press-and-hold repeat to numeric controls.

Related guides

Choose a value selector by task

A category, a measurement, and a numeric adjustment need different controls. Choose the value model before the visual material.

Choose from named options · Wheel Picker
Measured label centers handle uneven text widths; momentum settles on one discrete option.
Enter a physical measurement · Measure Ruler Picker
A ruler with snapping and unit switching makes neighboring measurements visible around the selected value.
Adjust a temperature target · Thermostat Dial
A circular dial connects degree selection to an arc and rolling temperature in a climate-control layout.
Adjust continuous levels · Gooey Merge Slider
A liquid thumb and track visualize channel levels; choose it for a bounded slider rather than named options or physical measurements.
Make precise one-step adjustments · Rolling Temperature Stepper (this piece)
Increase and decrease controls change a bounded value, with rolling digits instead of a drag surface.
Set a cart quantity · Quantity Stepper
An Add action expands into a compact quantity control and returns to its initial state at zero.
Choose a rating · Drag Star Rating
A bounded star scale communicates a qualitative score rather than a physical unit or arbitrary number.

A thermostat stepper with rolling digits and temperature-linked color washes, with configurable bounds, warm color, and font.

How it works

  1. onLayout supplies the card dimensions, and every radius, control zone, type size, and animation distance is derived from those measurements.
  2. The formatted number is split into right-aligned character windows. Each window owns one shared progress value and keeps an outgoing and incoming character, so unchanged digits remain completely still.
  3. When a second update interrupts a roll, the current incoming character becomes the next outgoing character. Its new progress starts below zero when necessary, preserving its on-screen position before it continues toward the next value.
  4. Two offset ghost copies follow each moving character. Their opacity and vertical stretch peak halfway through the roll to suggest motion blur without a native blur effect.
  5. A shared value from −1 to 1 drives the cool-to-warm tint, while its absolute value controls tint strength. Press and limit feedback remain independent from the displayed value.

Install

npx expo install expo-linear-gradient react-native-reanimated react-native-worklets

Usage

import RollingTemperatureStepper from './RollingTemperatureStepper';

export function ThermostatCard() {
  return <RollingTemperatureStepper style={{ width: 143, height: 218 }} />;
}

Use a controlled value, visual knobs, and the imperative API when integrating it into a larger climate screen:

import { useRef, useState } from 'react';
import RollingTemperatureStepper, {
  type RollingTemperatureStepperRef,
} from './RollingTemperatureStepper';

export function ThermostatCard() {
  const [temperature, setTemperature] = useState(70);
  const stepperRef = useRef<RollingTemperatureStepperRef>(null);

  return (
    <RollingTemperatureStepper
      ref={stepperRef}
      value={temperature}
      min={55}
      max={82}
      neutral={68}
      tintRange={8}
      warmColor="#E9A7AF"
      coolColor="#9FC3EE"
      fontFamily="YourSansFont"
      onChange={setTemperature}
      style={{ width: 160, height: 244 }}
    />
  );
}

The forwarded ref exposes increment(), decrement(), and setValue(value). In controlled mode these methods request a value through onChange; the visible number follows the value prop.

Props

PropTypeDefaultDescription
valuenumberundefinedControlled value. Omit to let the component keep its own state.
defaultValuenumberDEFAULT_VALUEInitial value when uncontrolled.
minnumberDEFAULT_MINMinimum temperature.
maxnumberDEFAULT_MAXMaximum temperature.
stepnumberDEFAULT_STEPAmount changed by each press.
neutralnumberDEFAULT_NEUTRALTemperature with no tint.
tintRangenumberDEFAULT_TINT_RANGEDegrees above/below neutral at which the tint is full.
unitstring'°'Unit displayed after the number.
warmColorstringDEFAULT_WARMWarm tint color.
coolColorstringDEFAULT_COOLCool tint color.
cardColorstringDEFAULT_CARDCard background color.
textColorstringDEFAULT_TEXTNumber and control color.
repeatOnHoldbooleantrueRepeat while holding a half.
fontFamilystringundefinedFont family for the number.
onChange(value: number) => voidundefinedCalled when the user or imperative API requests a new value.
incrementAccessibilityLabelstring'Increase temperature'Label for the upper control.
decrementAccessibilityLabelstring'Decrease temperature'Label for the lower control.
styleStyleProp<ViewStyle>undefinedOptional style for the outer card.
testIDstringundefinedTest identifier applied to the outer card.
durationnumber450Temperature tint transition duration in milliseconds. Spring physics and reduced-motion timing are unchanged.

Compatibility

  • Expo SDK 58
  • React Native 0.88
  • Reanimated 4.7
  • iOS: supported
  • Android: supported
  • Web: supported
  • Works in Expo Go because its native dependencies are bundled with the SDK

Accessibility

Both halves are labeled buttons, with overridable labels for product-specific wording. Reduced Motion replaces digit travel with a 120 ms crossfade, removes the ghost trail and card scale, and keeps value, tint, press feedback, and limit behavior functional.

FAQ

Does the animated counter work in Expo Go and on web?
Yes. Its Expo SDK 58 and Expo SDK 57 dependencies are available in Expo Go, and web is verified by the project gate. Each published piece is reviewed on physical iPhone and Android devices with Expo Go before release.
Can it display values other than temperature?
Yes. Configure value, min, max, step, neutral, unit, colors, and callbacks. The temperature labels can also be replaced through the accessibility label props.
How does the counter behave with Reduce Motion?
Digit travel becomes a short crossfade, and the ghost trail and card scale are removed. The value, tint, controls, and limit behavior remain fully functional.