Stepper

A component that guides users through a multi-step process with visual progress indication.

Overview

The Stepper component provides a visual representation of a multi-step process, allowing users to navigate through sequential steps with clear progress indication. It supports both horizontal and vertical orientations, controlled and uncontrolled states, and includes loading states for asynchronous operations.

Usage

import {
  Stepper,
  StepperIndicator,
  StepperItem,
  StepperTitle,
  StepperTrigger,
  StepperDescription,
  StepperSeparator,
} from "@tilt-legal/cubitt-components/primitives";
<Stepper defaultValue={1}>
  <StepperItem step={1}>
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Step One</StepperTitle>
    </StepperTrigger>
  </StepperItem>
  <StepperItem step={2}>
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Step Two</StepperTitle>
    </StepperTrigger>
  </StepperItem>
</Stepper>

Examples

Basic Stepper

A horizontal stepper with titles and descriptions.

Vertical Orientation

Stepper with vertical orientation for more detailed descriptions.

Mixed Elements

Stepper with custom indicators including images, loading states, and icons.

Progress Bar Style

Stepper styled as a progress bar.

URL State

Stepper with URL state synchronization for shareable progress.

Animated Content

Stepper with smooth height transitions when content is added or removed. Enable with animateContent prop.

API Reference

Stepper

Root component that manages stepper state.

PropTypeDefaultDescription
defaultValuenumber0The default active step when uncontrolled.
valuenumber-The controlled active step value.
onValueChange(value: number) => void-Event handler called when the active step changes.
orientation'horizontal' | 'vertical''horizontal'The orientation of the stepper.
animateContentbooleanfalseWhen true, content within StepperItem animates with smooth height transitions.
classNamestring-Additional CSS classes to apply to the stepper.

URL State Props

The following props enable URL state management by syncing the stepper step with URL parameters via TanStack Router search params. When paramName is provided, the stepper's state will be reflected in the URL.

PropTypeDefaultDescription
paramNamestring-URL parameter name for syncing state with URL. When provided, enables URL state management.
paramValuenumber-Controlled value for the URL parameter (syncs with stepper value).
onUrlValueChange(value: number | null) => void-Callback when URL parameter value changes.
paramClearOnDefaultbooleantrueRemove URL param when value equals default.
paramThrottlenumber-Throttle URL updates in milliseconds.
paramDebouncenumber-Debounce URL updates in milliseconds.

StepperItem

Container for individual step content.

PropTypeDefaultDescription
stepnumber-The step number for this item (required).
completedbooleanfalseWhether this step is completed.
disabledbooleanfalseWhether this step is disabled.
loadingbooleanfalseWhether this step is in a loading state.
classNamestring-Additional CSS classes for the item.

StepperTrigger

Button that activates the step.

PropTypeDefaultDescription
renderReactElement-Custom element to render as the trigger
classNamestring-Additional CSS classes for the trigger

StepperIndicator

Visual indicator for the step (number, icon, or custom element).

PropTypeDefaultDescription
childrennode-Custom content to render in the indicator
classNamestring-Additional CSS classes for the indicator

StepperTitle

The title text for the step.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the title.

StepperDescription

Description text that provides context about the step.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the description.

StepperSeparator

Visual separator between steps.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the separator.

On this page