rslabdocs

Stepper

A +/- counter with clamped bounds, a haptic on every tap, and a quick pop on the number when it changes.

ReanimatedHapticsNativeWindSource

Prerequisites

The stepper only needs icons, haptics, and Reanimated.


npx expo install @hugeicons/core-free-icons @hugeicons/react-native expo-haptics react-native-reanimated

Install


npx @rslab/cli add stepper

Usage

import { Stepper } from '@/components/ui/Stepper';

const [qty, setQty] = useState(1);

<Stepper value={qty} onChange={setQty} min={1} max={10} />;

Bound it to whatever range and increment the field needs:

<Stepper
  value={guests}

  onChange={setGuests}

  min={0}

  max={8}

  step={2}

  disabled={soldOut}
/>

Props

PropTypeDefault
value
number
-

The current count. Controlled.

onChange
(value: number) => void
-

Called with the clamped next value on every tap.

min?
number
-Infinity
max?
number
Infinity
step?
number
1

Amount added or subtracted per tap.

disabled?
boolean
false

Fades the whole pill and blocks both buttons.

haptic?
boolean
true

Light haptic tick on a tap that actually changes the value.

className?
string
-

Extend or override the outer pill.

See exactly how this works with an RSLAB subscription.

Get Pro

On this page