State Flow

A component for displaying a state flow

Default
Default state flow
Current State: idle
IdleReady
>
LoadingProcessing...
>
SuccessComplete!
v
ErrorFailed

idle → loading → success

loading → error (on failure)

1import { StateFlow } from "@/components/ui/state-flow"
2
3export default function Example() {
4 return <StateFlow />
5}
Async State Journey
Simulated API and processing states for visual debugging of async UI transitions.

Async State Journey Playground

Replace generic spinners with a visible lifecycle debugger for async UI work.

Current State: idle
IdleReady to submit
>
LoadingCreating account...
>
SuccessUser created
v
ErrorValidation failed

Timeline

Choose a scenario and run a simulation.

Scenario: Form Submission

Runs: 0

Last duration: N/A

1import { StateFlowAsyncPlayground } from "@/components/state-flow-demo";
2
3export default function Example() {
4 return <StateFlowAsyncPlayground />
5}

Props

NameTypeDefaultDescription
statestringidleThe current state of the flow
labelstringIdleThe label of the current state
descriptionstringReadyThe description of the current state
activebooleanfalseWhether the current state is active
directionstringhorizontalThe direction of the flow
isActivebooleanfalseWhether the current state is active
intentstringprimaryThe intent of the flow