Skip to content
Sign upGet access
MicrointeractionsUpload resolveMenu

Upload resolve (Pro)

ProIncluded in $99

An image attachment that resolves as it uploads: coarse blocks of its own colours sharpen in steps, with a trace round the thumbnail.

ProThree photos upload into the composer: each sharpens in steps from coarse blocks as its bytes arrive, one fails and retries.

The picture is the progress bar. The thumbnail starts as a few coarse blocks of its own colours and sharpens in five steps as the bytes arrive, with a hairline tracing the thumbnail's edge for the exact amount. When it lands the trace closes and lets go and the percent becomes the file's size. A failed upload drains to gray and offers a retry in place.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/upload-resolve

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { UploadResolve } from "@/components/ui/chatcn/pro/upload-resolve"

<UploadResolve
  src={URL.createObjectURL(file)}
  name={file.name}
  bytes={file.size}
  progress={upload.progress}
  status={upload.status}
  onRemove={() => remove(file)}
  onRetry={() => retry(file)}
/>

Examples

States

ProThree photos in each state: resolving at 38 percent, sharp and done, and stopped with a retry.

Props

PropTypeNotes
srcstringThe picked image; an object URL works
namestringTruncates with a title for the full name
bytesnumberShown once the upload lands
progressnumber0 to 1
status"uploading" | "done" | "error"
onRemove / onRetry() => voidEach shows its button when passed

Accessibility

  • Remove and retry are named with the file: Remove falls-at-dawn.webp.
  • The percent, the size or the failure is a polite live region.

Motion

  • The canvas redraws only when the block size changes (20, 10, 5, 3, 2, sharp), never per frame.
  • Reduced motion: two states only, coarse until it lands, then sharp.