Upload resolve (Pro)
ProIncluded in $99An image attachment that resolves as it uploads: coarse blocks of its own colours sharpen in steps, with a trace round the thumbnail.
On this page
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
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
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
| Prop | Type | Notes |
|---|---|---|
src | string | The picked image; an object URL works |
name | string | Truncates with a title for the full name |
bytes | number | Shown once the upload lands |
progress | number | 0 to 1 |
status | "uploading" | "done" | "error" | |
onRemove / onRetry | () => void | Each 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.