ImageReveal

ImageReveal is an animated image reveal component for React Native and React, from the dissolve library. Image generation loader: a thinking mosaic that resolves coarse to fine, then settles in grains.

A loader for generated images. While pending, a 12 by 12 mosaic pulses with a slow diagonal wave. When the image arrives, it resolves from 8 to 128 cells in 1.4 s on a smoothstep, one even step per doubling, each cell switching to the real color past its own random threshold, then the finest mosaic crossfades into the sharp image in 180 ms. On error, the mosaic freezes, tints red and leaves as dust. The mosaic is one shader, no view per cell.

Install

React Native

Install the engine once per app and wrap the root layout in <DissolveProvider> (see Installation), then copy the component into components/dissolve:

npx expo install dissolve-ui @shopify/react-native-skia react-native-reanimated react-native-worklets react-native-gesture-handler expo-haptics
npx dissolve-ui add image-reveal --native
npx shadcn@latest add https://dissolve.rselmi.com/r/native/image-reveal.json

React

Needs React 19 and react-dom, nothing else: no engine, no provider, no Tailwind. Works in the Next.js App Router.

npx dissolve-ui add image-reveal --web
npx shadcn@latest add https://dissolve.rselmi.com/r/image-reveal.json

Usage

ImageReveal.tsx (React Native)
import { ImageReveal } from '@/components/dissolve/image-reveal';

<ImageReveal
  src={result?.uri}
  status={failed ? 'error' : result ? 'ready' : 'pending'}
  onRevealed={() => setShowActions(true)}
  onDismissed={retry}
  className="rounded-[20px]"
/>
ImageReveal.tsx (React)
import { ImageReveal } from '@/components/dissolve/image-reveal';

<ImageReveal
  src={result?.uri}
  status={failed ? 'error' : result ? 'ready' : 'pending'}
  onRevealed={() => setShowActions(true)}
  onDismissed={retry}
  className="rounded-[20px]"
/>

Props

PropTypeDefaultDescription
srcDataSourceParamThe generated image (require(...) or a uri). Reveals once loaded and status is ready.
status'pending' | 'ready' | 'error'src ? 'ready' : 'pending'Pending shows the thinking mosaic, error sends it away as dust.
durationnumber1400Coarse to fine resolve, in ms. A 180 ms crossfade to the sharp image follows.
cellsnumber160Finest mosaic across the width before the sharp image (8, 16, 32, 64, 128).
aspectRationumber1Width / height of the frame.
onRevealed() => voidCalled once the sharp image is fully shown.
onDismissed() => voidError: called once the mosaic has left as dust.
hapticsbooleantrueA tick at each resolution doubling, success at the end.
classNamestringClasses of the frame: size, radius.

Source

Previous: ThinkingOrb · Next: SweepTransition · All components

dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.