Skip to content
Sign in
EffectsASCII revealMenu

ASCII revealPro

The image renders first as ASCII in Geist Mono, then each glyph cell dissolves into a pixel of the picture's own color, and the pixels resolve into the photo.

ProASCII in Geist Mono dissolving cell by cell into pixels, then the photo, at 48, 72 or 96 columns.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/ascii-reveal

Usage

tsx
import { AsciiReveal } from "@/components/ui/chatcn/pro/ascii-reveal"

<AsciiReveal src={image.url} alt={image.prompt} columns={72} />

Glyphs are matched by shape (edges read as / \ | _) from the shared glyph atlas and drawn once per size and theme. The dissolve is one draw per frame, so 96 columns stay smooth.

Examples

States

Waiting for the image, running at 40%, running with no numbers, held by revealed={false}, revealed, a missing file, a timer and right to left.

ProEvery state of the ASCII reveal.

Props

PropTypeNotes
src, altstringalt is required: the accessible name, announced once the image is in
progressnumber | nullReal job progress, 0 to 1. null means running with no numbers. Leave it out for timer mode
revealedbooleanTimer mode: false holds the first frame, true plays once the image loads. Default true
durationnumberTimer length in ms. Default 2400
onRevealed() => voidOnce per image, when the plain image shows
onStatusChange(status: "loading" | "ready" | "revealing" | "revealed" | "error") => void
aspectRatio, width, heightSet the frame before the image loads, so nothing shifts
paperstringThe ground under the effect. Token or CSS color. Default var(--chatcn-bg)
announcementstring | falseWhat the live region says once revealed. Default Image ready: <alt>
errorText, retryLabelCopy for the error state and its reload button
columnsnumberCharacters across. Default 64
mode"shape" | "luminance"Default shape
order"random" | "bayer" | "rows" | "diagonal" | "center"Order the cells turn into pixels. Default random
seednumberSeeds the dissolve. Default 1
ink, contrastGlyph color and contrast. Defaults var(--chatcn-fg) and 1.15
maxPixelsnumberDefault 1.5 MP

Keyboard

KeyAction
TabReaches the Reload image button in the error state. The reveal itself takes no focus

Accessibility

  • The effect layer is aria-hidden. The real <img> with your alt is always there, and the frame is aria-busy until the reveal ends.
  • A polite live region says Image ready: <alt> once, when the plain image shows. Progress ticks are never announced.
  • Under forced-colors: active the effect hides and the plain image shows with system colors.
  • A broken file shows what happened and a Reload image button that retries the download.

Motion

  • The ASCII holds for 18% of the run, cells flip to pixels over 57%, then the pixels crossfade to the photo. Cells flip, they never slide.
  • Under reduced motion one still frame holds while the job runs, then the image crossfades in over 200 ms. Nothing moves.
  • The timer only runs on screen in a visible tab; offscreen it waits where it was.