Docyrus

Stepper

Compound step indicator for multi-step wizards and onboarding flows — six variants, per-step status, non-linear navigation and animated connectors.

iOSAndroid
Preview Stepper on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-stepper
Required Packages(4 packages)
pnpm add react-native-reanimated react-native-svg tailwind-variants expo-linear-gradient (optional)

The API mirrors the web Stepper 1:1 (Stepper + Step + StepConnector, same contexts and hooks). expo-linear-gradient is an optional peer: when it is installed the gradient variant renders a shimmering sweep on the active step, otherwise it falls back to a solid primary fill.

Usage

import { Step, Stepper } from '@/components/docyrus-native/stepper';

<Stepper activeStep={1}>
  <Step label="Account" description="Create your account" icon="fal user" />
  <Step label="Profile" description="Set up your profile" />
  <Step label="Billing" optional />
  <Step label="Complete" />
</Stepper>

Steps array

The steps prop is a native convenience that maps onto <Step> children:

<Stepper
  steps={[
    { label: 'Account', description: 'Create your account' },
    { label: 'Profile', status: 'error', description: 'Missing avatar' },
    { label: 'Complete' }
  ]}
  activeStep={1}
  variant="outline"
  alternativeLabel
/>

Non-linear navigation

const [active, setActive] = useState(0);

<Stepper activeStep={active} nonLinear onStepClick={setActive}>
  <Step label="Details" />
  <Step label="Members" />
  <Step label="Locked" disabled />
</Stepper>

Vertical with content

In vertical orientation a step's children render beside the connector below it.

<Stepper activeStep={1} orientation="vertical">
  <Step label="Upload file" description="CSV or XLSX">
    <Text>contacts.csv — 1,204 rows</Text>
  </Step>
  <Step label="Map columns" />
  <Step label="Import" />
</Stepper>

Custom connector

<Stepper activeStep={1} variant="dashed" connector={<StepConnector animated={false} />}>
  ...
</Stepper>

Variants

VariantDescription
defaultFilled circles (muted → primary), check on finished steps, pulsing ring on the active step
outlineBordered circles; finished steps fill with primary
dotsSmall dots with the label underneath; the active dot springs to 1.2× and pulses
dashedDashed border on waiting steps and dashed connectors
gradientFilled circles with a shimmering gradient sweep on the active step (expo-linear-gradient, solid fallback)
minimalNo circles — inline check / error glyph next to the label and an underline under the active step

Sizes

SizeIndicatorGlyph
sm24px12px
default32px16px
lg40px20px

md is still accepted as an alias of default.

API Reference

Stepper

PropTypeDefaultDescription
childrenReactNode—<Step> elements (fragments are flattened). Ignored when steps is provided
stepsStepItem[]—Native convenience — array alternative to <Step> children
activeStepnumber0Index of the active step. Steps before it are finish, it is process, steps after are wait
currentStepnumber—Deprecated alias of activeStep
variant'default' | 'outline' | 'dots' | 'dashed' | 'gradient' | 'minimal''default'Visual style
size'sm' | 'default' | 'lg' | 'md''default'Indicator and text size (md = default)
orientation'horizontal' | 'vertical''horizontal'Layout direction
nonLinearbooleanfalseMakes non-disabled steps pressable (requires onStepClick)
onStepClick(index: number) => void—Called with the pressed step index when nonLinear
alternativeLabelbooleanfalseHorizontal only — puts labels under the indicators (always on for dots)
connectorReactNode<StepConnector />Custom connector element rendered between steps
scrollablebooleantrueHorizontal only — wraps the steps in a horizontal ScrollView so long steppers scroll instead of squeezing, and scrolls the active step into view
classNamestring—Root classes
labelClassNamestring—Extra classes for every step label
descriptionClassNamestring—Extra classes for every step description
refRef<View>—Root view ref

Also accepts every ViewProps prop.

Step

PropTypeDefaultDescription
labelReactNode—Step label (strings are wrapped in Text)
descriptionReactNode—Secondary text under the label
iconReactNode | string—Replaces the number / check / error glyph. A string renders a DocyrusIcon (e.g. "fal user") tinted for the status
status'wait' | 'process' | 'finish' | 'error'derivedOverrides the status derived from activeStep
optionalbooleanfalseShows an "Optional" caption (ui.stepper.optional)
disabledbooleanfalseExcludes the step from nonLinear navigation and dims it
childrenReactNode—Vertical only — content rendered beside the connector below the step
classNamestring—Step container classes
labelClassNamestring—Label classes (merged after the Stepper-level one)
descriptionClassNamestring—Description classes
refRef<View>—Step view ref

Also accepts every ViewProps prop.

StepConnector

PropTypeDefaultDescription
animatedbooleantrueAnimates the completion fill (400 ms, reanimated). When false the fill snaps
classNamestring—Connector track classes
refRef<View>—Connector view ref

The completed state is read from StepConnectorCompletedContext (set by Stepper for each gap).

StepItem

PropertyTypeDescription
keystringStable React key (defaults to step-<index>)
labelReactNodeStep label
descriptionReactNodeSecondary text
iconReactNode | stringCustom glyph (string → DocyrusIcon)
statusStepStatusStatus override
optionalbooleanShows the "Optional" caption
disabledbooleanNot pressable in nonLinear mode
contentReactNodeVertical only — rendered beside the connector (the Step children)

StepperContextValue

FieldTypeDescription
activeStepnumberResolved active step
orientationStepperOrientationLayout direction
variantStepperVariantVisual style
sizeStepperSizeNormalized size (md → default)
nonLinearbooleanWhether steps are pressable
alternativeLabelbooleanLabels under indicators
onStepClick(index: number) => voidStep press handler
totalStepsnumberNumber of steps
labelClassNamestringNative-only — Stepper-level label classes
descriptionClassNamestringNative-only — Stepper-level description classes

Components

ComponentDescription
StepperRoot — lays out steps and connectors, provides the contexts
StepA single step (indicator + label + description)
StepConnectorLine between two steps with an animated completion fill

Hooks & Contexts

ExportDescription
useStepperContext()Reads StepperContextValue (throws outside <Stepper>)
useStepIndex()Index of the enclosing step
useStepConnectorCompleted()Whether the enclosing connector's previous step is finished
StepperContextContext carrying StepperContextValue
StepIndexContextContext carrying the step index
StepConnectorCompletedContextContext carrying the connector completed flag
stepperVariantstv() root variants (variant, size, orientation)

Translations

KeyEnglish fallback
ui.stepper.progressProgress (root accessibility label)
ui.stepper.optionalOptional

Type Exports

TypeDescription
StepperPropsProps for Stepper
StepPropsProps for Step
StepConnectorPropsProps for StepConnector
StepItemEntry of the steps array prop
StepStatus'wait' | 'process' | 'finish' | 'error'
StepperVariant'default' | 'outline' | 'dots' | 'dashed' | 'gradient' | 'minimal'
StepperSize'sm' | 'default' | 'lg'
StepperOrientation'horizontal' | 'vertical'
StepperContextValueValue of StepperContext

On this page