Skip to content
Native Animation
Quantity Stepper animation preview

Quantity Stepper

An Add button that expands into a compact rolling quantity control and collapses again at zero.

$9 for this animation

Checkout opens soon. Leave your email and we will tell you the moment you can buy it.

One email when checkout opens. No spam.

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.

npx nativeanimation add quantity-stepper

About this animation

An Add button that expands into a compact rolling quantity control and collapses again at zero.

How it works

  1. A shared progress value springs the control width and crossfades its two modes.
  2. Value changes commit outgoing and incoming numbers together before the roll begins.
  3. Press-and-hold starts after 420 ms and repeats every 110 ms.
  4. The first expansion triggers a short accent halo and clipped light sweep across the surface.
  5. Controlled and uncontrolled modes clamp every request to the configured range.

Install

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

Usage

import QuantityStepper from './QuantityStepper';

<QuantityStepper onChange={(quantity) => updateCart(quantity)} />;
<QuantityStepper defaultValue={2} min={0} max={12} accentColor="#137D68" colorScheme="dark" />;

Props

PropTypeDefaultDescription
value / defaultValuenumber— / 0Controlled or initial quantity.
onChange(value: number) => void—Receives clamped requests.
min / maxnumber0 / 99Quantity bounds.
accentColor / textColorstringPurple / whiteControl colors.
addLabelstring'Add'Collapsed label.
width / collapsedWidth / heightnumber142 / 88 / 46Control dimensions.
durationnumber240Expand/collapse duration.
fontFamilystringSystem fontLabel and number font.
colorScheme'light' | 'dark' | 'auto''auto'Surface appearance, with system-aware dark mode.
repeatOnHoldbooleantrueEnables press-and-hold repeat.
accessibility labelsstringDescriptive defaultsAdd, increase, and decrease labels.
style / testIDstyle / string—Container and test customization.

The ref exposes increment(), decrement(), setValue(value), and reset().

Compatibility

  • Expo SDK 57, React Native 0.86, and Reanimated 4.5
  • iOS, Android, and web supported; device verification pending
  • Works in Expo Go

Accessibility

Each action is a labeled button and plus/minus controls announce disabled bounds. Reduced Motion removes expansion, scale, and rolling travel while retaining a short number crossfade.