Grid Reveal
betaA loading frame for a generated image: it opens as four shimmering cells, keeps splitting its largest cell as the wait goes on, then resolves cell by cell — busiest detail first — into the real picture.
- AI
- 1 file
- 2 npm packages
- Accessibility notes
- Draws on a canvas
pnpm dlx @dowel-ui/cli add grid-revealnpm packages installed: class-variance-authority, motion.
import { GridReveal } from "@/components/ui/grid-reveal";Default
Generate
Controlled Progress
Aspects
Gutters
Revealed
<GridReveal>
| Prop | Type | Default |
|---|---|---|
altDescribes the finished image. Without it the frame is hidden from assistive technology. | string | — |
aspectWidth ÷ height of the frame. It fills its parent's width, so size the parent. | number | 1 |
captionStatus text in a frosted pill at the bottom-start of the frame. Changes cross-fade. | string | — |
crossOriginForwarded to the images. Set "anonymous" for a CORS-enabled host so the reveal order can read the pixels. | "anonymous" | "use-credentials" | — |
estimatedDurationRoughly how long the work takes, in ms, to pace the grid without | number | 10000 |
gutter | "none" | "sm" | "md" | "sm" |
onErrorFires when the image fails to load. The grid keeps waiting, so show your own fallback. | () => void | — |
onRevealCompleteFires once the image has fully resolved. | () => void | — |
progressHow far through the wait, 0–1; drives how far the grid has split. Held at 0.72 until the image decodes. Omit it to pace the grid by | number | — |
srcThe image to reveal. Keep it null while the image is generating — the grid only runs while it is empty, and a src that is already loaded makes the whole run flash by. | string | null | null |
Plus every attribute of <div> except children, onError.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes