Stepper
Flow position and completion states with optional named step navigation.
npx @swipeui/cli add stepperWhen to use it
- Checkout, sign-up or setup flows with named steps, such as Cart, Shipping and Payment.
- Showing which steps are done, current and upcoming.
- Letting people jump back to an earlier step.
When not to use it
- Paging through images. Use Page dots.
- Plain progress without names. Use Progress.
- Number entry with plus and minus. Use Number field.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add stepper- Adds
components/swipeui/ui/stepper.tsxand 8 shared helpers. - Installs react-native-reanimated, react-native-svg, uniwind, react-native-worklets, clsx, tailwind-merge, expo-haptics, class-variance-authority. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { Stepper } from '@/components/swipeui/ui/stepper';
<Stepper current={step} steps={steps} />;Examples
Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.
API reference
StepperProps
| Prop | Type | Default | Description |
|---|---|---|---|
appearance? | | | Card or transparent surface. |
showProgress? | | | Optional quantitative track. |
connectors? | | | Join stages with a rail, separated from the circles. |
steps | | — | Flow steps in reading order. |
current? | | | Current step index, zero based. |
onStepPress? | | — | Enables step navigation; omit for read-only flow status. |
orientation? | | | Layout direction. |
messages? | | — | Spoken statuses, independent of colour. |
motion? | | — | Shared selection and press feel. |
haptics? | | | Action haptics. |
className? | | — | Root classes. |
style? | | — | Native layout escape hatch. |
testID? | | — | Root ID. |
Native view/input props not listed here pass through where the exported TypeScript type allows them.
Composition and behavior
- steps each have a label, optional caption/description, completion state and disabled flag.
- current marks the active step; orientation is vertical or horizontal.
- onStepPress makes steps tappable.
Feedback lineup settings
| Prop | Does / default |
|---|---|
id | Stable step identifier. |
label | Visible step name. |
caption | Optional short day or section label above the step name. |
description | Optional explanation. |
completed | Application-owned completion state. |
disabled | Prevent navigating to this step. |
appearance | Card or transparent surface. @default 'transparent' |
showProgress | Optional quantitative track. @default false |
connectors | Join stages with a visual rail. @default true |
steps | Flow steps in reading order. |
current | Current step index, zero based. @default 0 |
onStepPress | Enables step navigation; omit for read-only flow status. |
messages | Caller wording for current, completed and upcoming status. |
orientation | Layout direction. @default 'vertical' |
motion | Shared selection and press feel. |
className | Root classes. |
style | Native layout escape hatch. |
testID | Root ID. |
Behaviour
A stepper names stages in a flow; a Progress bar measures an amount. The app controls current/completed/disabled steps and decides which navigation is permitted.
Action haptics can be disabled independently with haptics={false} (default true).
The first step starts selected. Current and completed circles contain a green check; future circles are empty. Rails occupy only the gaps between circles and turn green as the preceding stage completes. Rows have no highlight box. The vertical specimen explains the three trial milestones; the horizontal specimen keeps the Account, Details and Review flow.
Behavior and gestures
- Shows completed, current and upcoming steps, vertically or horizontally.
- With onStepPress, tap a step to go to it; disabled steps can't be tapped.
- Without it, the stepper is read-only status.
Accessibility
- Each step reads its name and status, such as "Shipping, current" or "Cart, completed".
- Descriptions are read after the status.
- The current step is marked selected.
Motion
- Uses the
select,pressandnumbermotion roles, so it follows your app's feel. Passmotionto tune this one instance. - Checks and connectors animate with the shared select role; optional progress uses number. Reduce Motion makes state changes instant.
Performance
- Simple rows; cheap to re-render as the flow advances.
Notes for AI
- current is zero-based; mark steps disabled when they can't be revisited.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.