VideoGen

A compound component for rendering video generation progress. Handles the full lifecycle: idle, queued, processing, rendering, done, and error.

VideoGen — Interactive Demo
state: idle
VideoGen — All 6 States

Import

tsx
import { VideoGen } from "@arc-lo/ui";

Basic usage

tsx
<VideoGen.Root state="processing" poster={posterUrl} progress={42}>
  <VideoGen.Placeholder />
  <VideoGen.Thumbnail />
  <VideoGen.Player />
  <VideoGen.Progress />
  <VideoGen.StageLabel />
  <VideoGen.PlayButton />
  <VideoGen.ErrorFallback />
</VideoGen.Root>

With toolbar and callbacks

tsx
<VideoGen.Root
  state={state}
  src={videoUrl}
  poster={posterUrl}
  progress={progress}
  aspectRatio="16/9"
  duration={duration}
  prompt="A cat riding a skateboard"
  onRetry={() => regenerate()}
  onDownload={() => saveVideo()}
  onPlay={() => analytics.track("play")}
>
  <VideoGen.Placeholder />
  <VideoGen.Thumbnail />
  <VideoGen.Player autoPlay muted loop />
  <VideoGen.Progress />
  <VideoGen.StageLabel />
  <VideoGen.PlayButton />
  <VideoGen.ErrorFallback message="Generation failed." />
  <VideoGen.Toolbar>
    <button onClick={onDownload}>Download</button>
  </VideoGen.Toolbar>
</VideoGen.Root>

States

StateDescriptionVisible parts
idleNo generation in progressPlaceholder
queuedWaiting in generation queuePlaceholder, Progress
processingModel is generating framesThumbnail, Progress, StageLabel
renderingFinal rendering / encodingThumbnail, Progress, StageLabel
doneVideo ready for playbackPlayer or Thumbnail, PlayButton, Toolbar
errorGeneration failedErrorFallback

Props

Root
PropTypeDefaultDescription
stateVideoGenStateCurrent generation state
srcstring | nullVideo source URL when done
posterstring | nullThumbnail / poster image URL
progressnumberProgress percentage (0-100)
aspectRatiostring"16/9"CSS aspect-ratio for the container
durationnumber | nullVideo duration in seconds
promptstringGeneration prompt text
onRetry() => voidCalled when retry is clicked in error state
onDownload() => voidCalled when download is triggered
onPlay() => voidCalled when play button is clicked