Components/AI

Step Progress Timeline

Animated step progress timeline with sequential generation states and visual connectors

Live Preview
Open in

Example

export default function StepProgressTimelineExample() {

const steps = [
    { step: 1, stepName: "Initializing system", duration: 2000, status: "waiting..." as const },
    { step: 2, stepName: "Loading dependencies", duration: 3000, status: "waiting..." as const },
    { step: 3, stepName: "Processing request", duration: 2500, status: "waiting..." as const },
    { step: 4, stepName: "Generating content", duration: 4000, status: "waiting..." as const },
    { step: 5, stepName: "Optimizing output", duration: 2000, status: "waiting..." as const },
    { step: 6, stepName: "Finalizing results", duration: 1500, status: "waiting..." as const },
  ]

  const handleGenerationStart = () => {
    console.log('Generation started')
  }

  const handleGenerationComplete = () => {
    console.log('Generation completed')
  }

  const handleGenerationStop = () => {
    console.log('Generation stopped')
  }

  return (
    <StepProgressTimeline
      steps={steps}
      externalStart={true}
      externalStop={false}
      scrollSpeed="normal"
      onGenerationStart={handleGenerationStart}
      onGenerationComplete={handleGenerationComplete}
      onGenerationStop={handleGenerationStop}
      className="w-full"
    />
  )
}

Documentation

PropTypeDefaultDescription
stepsStepProps[]defaultStepsArray of step configurations
onGenerationStart() => voidundefinedCallback when generation starts
onGenerationComplete() => voidundefinedCallback when all steps complete
onGenerationStop() => voidundefinedCallback when generation stops
externalStopbooleanfalseExternal control to stop generation
externalStartbooleanfalseExternal control to start generation
classNamestringundefinedAdditional CSS classes for styling
scrollSpeed"fast" | "normal" | "slow""normal"Speed of scroll animations

Types

type StepProps = {
  step?: number
  stepName?: string
  duration?: number
  status: "waiting..." | "generating..." | "completed"
}

type StepProgressTimelineProps = {
  steps: StepProps[]
  onGenerationStart?: () => void
  onGenerationComplete?: () => void
  onGenerationStop?: () => void
  externalStop?: boolean
  externalStart?: boolean
  className?: string
  scrollSpeed?: "fast" | "normal" | "slow"
}

Features

  • Sequential Processing: Steps execute one after another with configurable durations
  • Visual States: Clear status indicators (waiting, generating, completed)
  • Progress Connectors: Animated connectors between completed steps
  • External Control: Start and stop generation from external components
  • Customizable Speed: Three scroll speed options for different use cases
  • Real-time Feedback: Live status updates with loading animations
  • Responsive Design: Adapts to different screen sizes with proper scaling
  • Dark Mode Support: Full dark mode compatibility with appropriate styling
  • Accessibility Focused: Screen reader friendly with proper semantic structure