Mist revealNew
The calm wait for a generated image: a slow band of colour drifts while it works, then the mist moves off and the picture sharpens into place.
Used forImage generatorsChat with imagesAvatars and coversProduct photos
Install with the shadcn CLI
Registered the namespace? Then it’s shadcn add @hairline/mist-reveal. Set it up
Templates
Need the whole page?
61 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 6 are free.
Where it’s used
Image generators
The frame a prompt’s result appears in.
Chat with images
An image a model is drawing inside a reply.
Avatars and covers
A generated profile picture or cover photo arriving.
Product photos
A background removal or a restyle being processed.
What it handles for you
Most image products show a spinner or a skeleton, then swap the image in with a hard cut, and many fake a progress bar that finishes before the image does.
Follows the real state
It waits on your status and on the image actually decoding, so it never finishes early or shows a half-loaded picture.
Calm while it works
A slow band of your chart colours drifts at a pace you can ignore; nothing spins or pulses.
One move to arrive
The mist leaves for a corner as the picture sharpens out of a blur, in one 1.1s move.
Honest progress
A rolling percentage only when your API gives one; otherwise no number at all.
Failure designed
A failed generation says so in the frame with Try again, instead of an empty box.
Already there, already shown
An image that was ready on page load appears without replaying the reveal.
Overview
Waiting for an image model is the moment a product looks either alive or stuck. While your generation runs, Mist reveal fills the frame with a slow band of your theme’s chart colours drifting through a quiet well, enough to say it is working without a spinner. It never guesses: it waits on your status, and only once the image is ready and has actually loaded does the mist move off towards a corner while the picture sharpens out of a soft blur in the same move. If your API reports progress, a small figure rolls in the corner; if it fails, the frame says so and offers Try again. The calm one of the four, for consumer apps.
States
- waiting
- A band of --chart-1, --chart-2 and --chart-4, blurred 28px, drifts 16% each way over 4.6s in the muted well. aria-busy is set.
- arriving
- Once status is "ready" and the image has decoded: the mist fades over 0.9s while moving 32% towards the bottom-right corner, and the image goes from blur(14px) and scale(1.06) to sharp in 1.1s.
- shown
- The plain image, its alt text intact. onReady fires.
- failed
- The well with “This image couldn’t be created.” and Try again when onRetry is passed.
Usage
Works with
Polling your generation API
Start a generation, poll its status, and hand the component the real state. Any API that reports generating, ready and failed works the same way.
Props
- src
- string
- The generated image. It can arrive before or with status "ready"; the reveal waits until it has loaded and decoded.
- status
- "generating" | "ready" | "error"
- Your generation’s real state. Nothing plays on a timer.
- progress
- number
- 0 to 1, if your API reports it. Shown as a small rolling figure; without it, no number is shown.
- alt
- string
- The image’s text alternative, usually its prompt.
- crossOrigin
- "anonymous" | "use-credentials"
- Set it when your image host sends CORS headers.
- onReady
- () => void
- Called once the reveal has played, or the image is shown without one.
- onRetry
- () => void
- Shows Try again when the generation fails.
- labels
- { generating?, ready?, failed?, retry? }
- Words for the progress tag, the announcements and the failure.
- className
- string
- Size the frame here, e.g. "aspect-square w-72".
Accessibility and motion
- It follows your status: it waits while "generating", and plays only once status is "ready" and the image has loaded and decoded (img.decode), so it can never finish before the picture does. An image that was already there when the page loaded is simply shown.
- The figure has aria-busy while it waits, and a status line announces Generating, Image ready or the failure; the image keeps its alt text.
- The mist is one blurred layer moved by a CSS animation, so it costs no script while it waits.
- Under reduced motion the image appears in place, with no drift while waiting.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
The CLI also installs Number roll.
Source
Registry item: /r/mist-reveal.json


