Thinking UI

Vision AnalysisPRO

A scan line sweeps the image, then labeled boxes draw in and a caption streams below.

Code

3 files · 326 lines of TypeScriptPRO

Vision Analysis is part of Pro

Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.

Motion notes

  • While scanning, the image dims and desaturates under a faint sampling grid, and a soft band with a bright leading edge sweeps top to bottom on an in-out ease.
  • Each box lands from a slight zoom, then its corner brackets extend out from the corners on a layout spring, and its label pops in last, so you read box, then label.
  • Boxes arrive several list-staggers apart, slow enough to read every label. Labels sit inside big boxes and outside small ones, so they stay in the frame and clear of each other.
  • Boxes are percentage rects, so they track the image at any size. With reduced motion there is no sweep and boxes fade in with their brackets already drawn.

Usage

Example
<VisionDetect
    src={image.url}
    status={result ? "done" : "scanning"}
    detections={result?.objects ?? []}
    caption={caption}
    captionStreaming={!captionDone}
  />

Props

PropTypeDefaultDescription
srcstring—The image being analyzed.
altstring—Describes the image; detections are appended for screen readers.
status"scanning" | "done"—Scanning sweeps the image; done draws the boxes in.
detectionsDetection[]—{ label, confidence (0–1), box: { x, y, w, h } } with the box in percent of the image.
captionstring—The model's description so far. Pass the growing string while it streams.
captionStreamingbooleanfalseShows a caret while more caption is expected.
rationumber3 / 4Frame width ÷ height. Match the image so boxes line up.
classNamestring—Size it here; the default is w-56.