Components/AI
Step Progress Timeline
Animated step progress timeline with sequential generation states and visual connectors
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
Prop | Type | Default | Description |
---|---|---|---|
steps | StepProps[] | defaultSteps | Array of step configurations |
onGenerationStart | () => void | undefined | Callback when generation starts |
onGenerationComplete | () => void | undefined | Callback when all steps complete |
onGenerationStop | () => void | undefined | Callback when generation stops |
externalStop | boolean | false | External control to stop generation |
externalStart | boolean | false | External control to start generation |
className | string | undefined | Additional 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