Components / AI interface
LoadingState
Pixel-grid loader with shimmer and elapsed time.
Install
npx shadcn@latest add https://irisui.dev/r/loading-state.jsonimport LoadingState from "@/components/iris/loading-state/loading-state";
Preview
LoadingState
An inline loader for long-running agent work: a 3×3 pixel-grid animation, a shimmering label and a live elapsed timer.
When to use
- Show that an agent is busy on something that takes seconds to minutes (indexing, drafting, running evals), where the elapsed time is useful.
- Pick a pattern:
Drive(square cells, chevron wavefront),Dots(the same wave on round cells) orOrbit(a comet lapping the grid edge). - Not for a step-by-step trace — use
ThinkingState. Not for determinate progress — useProgressorProgressRing. Not for content placeholders — useSkeleton.
Usage
import LoadingState from "@/components/iris/loading-state/loading-state";
h(LoadingState, { variant: "Drive", label: "Scanning ~/Documents" });
h(LoadingState, { variant: "Orbit", label: "Clustering stories" });
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
"Clustering stories" ("Transcribing the recording" for Surfer) |
The shimmering status text. Pass your own. |
variant |
"Drive" | "Dots" | "Orbit" | "Surfer" |
"Drive" |
Grid pattern. Surfer adds a video card below the Drive loader. |
videoSrc |
string |
— | Video for the Surfer variant's card: muted, looping, autoplaying. |
Notes
Surferneeds avideoSrc. Without one, or if the video fails to load, its card shows the loader and "Video unavailable".- The root is an
<output>(role="status"on theSurferwrapper, which holds block content). The timer counts up from mount in tenths of a second (12.4s, then1m 3.2s) and restarts when the component remounts. - The bundle's global reduced-motion rule stops the grid on its dim frame and stops the label shimmer, but the timer keeps ticking.
- The grid cells use
--inkat low opacity. The label shimmer runs between--ink-3and--ink, and the timer uses--font-codein--ink-3.