Components

Stepper

A multi-step progress indicator with 6 visual variants, horizontal/vertical orientation, animated transitions, and customizable step icons.

Client Only

Installation

pnpm dlx @docyrus/cli add @docyrus/ui-stepper
Required Packages(2 packages)
pnpm add motion @emotion/is-prop-valid

Usage

import {
  Stepper,
  useStepperContext
} from '@docyrus/ui/components/stepper';
import type { StepProps } from '@docyrus/ui/components/stepper';

const steps: StepProps[] = [
  { label: 'Account', description: 'Create your account' },
  { label: 'Profile', description: 'Set up your profile' },
  { label: 'Complete', description: 'All done!' }
];

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

  return (
    <Stepper activeStep={active} onStepClick={setActive}>
      {steps.map((step, i) => (
        <Stepper.Step
          key={i}
          label={step.label}
          description={step.description}
        />
      ))}
    </Stepper>
  );
}

Vertical Orientation

<Stepper activeStep={1} orientation="vertical">
  <Stepper.Step label="Step 1" />
  <Stepper.Step label="Step 2" />
  <Stepper.Step label="Step 3" />
</Stepper>

With Custom Icons & Status

<Stepper activeStep={1}>
  <Stepper.Step label="Upload" icon={<UploadIcon />} status="finish" />
  <Stepper.Step label="Process" status="process" />
  <Stepper.Step label="Review" status="error" />
  <Stepper.Step label="Publish" status="wait" />
</Stepper>

Variants

VariantDescription
defaultNumbered circles with filled background.
outlineOutlined circles with border.
dotsSmall dots with pulse animation on active step.
dashedDashed connector lines.
gradientGradient-filled indicators.
minimalText-only with subtle indicators.

Sizes

SizeDescription
smSmall indicators and text.
defaultStandard size.
lgLarge indicators and text.

Components

ComponentDescription
StepperRoot component with context provider. Renders the step layout.
Stepper.StepIndividual step with icon, label, description, and status.
StepConnectorLine between steps. Animates on completion.
useStepperContextHook to access stepper state (activeStep, variant, size, etc.).

API Reference

Stepper

PropTypeDefaultDescription
activeStepnumber0Current active step index.
variant'default' | 'outline' | 'dots' | 'dashed' | 'gradient' | 'minimal''default'Visual style of the stepper.
size'sm' | 'default' | 'lg''default'Size of step indicators.
orientation'horizontal' | 'vertical''horizontal'Layout direction.
nonLinearbooleanfalseAllow clicking on any step regardless of order.
alternativeLabelbooleanfalsePlace labels below indicators instead of beside them.
onStepClick(index: number) => void—Called when a step is clicked.
connectorReactNode—Custom connector component between steps.
classNamestring—Additional CSS classes.

Step

PropTypeDefaultDescription
labelReactNode—Step title text.
descriptionReactNode—Step subtitle/description.
iconReactNode—Custom step icon. Falls back to step number.
status'wait' | 'process' | 'finish' | 'error'—Manual status override. Auto-determined from activeStep if not set.
optionalboolean—Mark as optional step.
disabledboolean—Disable click interaction.

StepConnector

PropTypeDefaultDescription
animatedbooleantrueAnimate the connector fill on completion.

Type Reference

StepStatus

'wait' | 'process' | 'finish' | 'error'

StepperVariant

'default' | 'outline' | 'dots' | 'dashed' | 'gradient' | 'minimal'

StepperSize

'sm' | 'default' | 'lg'

StepperOrientation

'horizontal' | 'vertical'

On this page