Stepper
A +/- counter with clamped bounds, a haptic on every tap, and a quick pop on the number when it changes.
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
valuenumber-The current count. Controlled.
onChange(value: number) => void-Called with the clamped next value on every tap.
min?number-Infinitymax?numberInfinitystep?number1Amount added or subtracted per tap.
disabled?booleanfalseFades the whole pill and blocks both buttons.
haptic?booleantrueLight 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