Ruixen Pro is now live.30+ premium components, templates, blocks, and lifetime updates.

Command Palette

Search for a command to run...

Docs
Nav Stepper

Nav Stepper

A navigable stepper with previous/next buttons. Supports numbered, dot, and bar indicator variants with inline or bottom navigation positioning.

Installation

Usage

import { NavStepper, NavStepData } from "@/components/ruixen/nav-stepper";
const steps: NavStepData[] = [
  { id: 1, label: "Details" },
  { id: 2, label: "Address" },
  { id: 3, label: "Payment" },
  { id: 4, label: "Review" },
];
 
<NavStepper
  steps={steps}
  currentStep={1}
  onStepChange={setStep}
  variant="numbered"
/>;

Examples

Numbered with Inline Arrows

<NavStepper
  steps={steps}
  currentStep={1}
  variant="numbered"
  navPosition="inline"
/>

Dot Indicators

<NavStepper steps={steps} currentStep={2} variant="dots" navPosition="inline" />

Bar Indicators

<NavStepper steps={steps} currentStep={1} variant="bars" navPosition="inline" />

Bottom Navigation

<NavStepper
  steps={steps}
  currentStep={2}
  variant="numbered"
  navPosition="bottom"
/>

With Loading State

<NavStepper steps={steps} currentStep={1} loading={isLoading} />

Without Navigation Buttons

<NavStepper steps={steps} currentStep={1} showNavButtons={false} />

Props

PropTypeDefaultDescription
stepsNavStepData[]RequiredArray of step definitions
defaultStepnumber0Default step index
currentStepnumber-Controlled step index
onStepChange(step: number) => void-Callback when step changes
loadingbooleanfalseShow loading state
showNavButtonsbooleantrueShow prev/next buttons
navPosition"inline" | "bottom""inline"Navigation button position
variant"numbered" | "dots" | "bars""numbered"Indicator style variant
PropertyTypeDescription
idstring | numberUnique identifier
labelstringStep label

Hooks

useNavStepper

Access navigation context from child components.

const {
  currentStep,
  totalSteps,
  goToStep,
  goNext,
  goPrev,
  canGoNext,
  canGoPrev,
  isLoading,
} = useNavStepper();