Mobile › Inputs

Stepper

Minus and plus buttons for small counts, such as guests or quantity.

Installation

npx expo install plankui-mobile react-native-safe-area-context expo-haptics

Usage

import { Stepper } from "plankui-mobile";

const [guests, setGuests] = useState(2);

<Stepper value={guests} onChange={setGuests} min={1} max={8} accessibilityLabel="Guests" />

iOS and Android

iOS: The iOS stepper: two halves of one grey capsule.

Android: An outlined pill with the count between minus and plus.

API reference

PropTypeDefaultDescription
valuenumberCurrent count.
onChange(v: number) => voidCalled with the new count.
minnumber0Lowest count; minus disables there.
maxnumber99Highest count; plus disables there.
stepnumber1Increment.
accessibilityLabelstringWhat it counts.