Props Reference
Complete reference for the core data types.
type UploadFileItem Type
| Property | Type | Description |
|---|---|---|
uid | string | Unique identifier generated by Uplofile |
id | string? | Optional ID from your backend |
name | string | File name |
status | UploadStatus | Current status: "idle", "uploading", "done", "error", "canceled", "removing" |
progress | number? | Upload progress (0-100) |
previewUrl | string? | URL for image preview (object URL or remote URL) |
url | string? | Remote URL of the uploaded file |
error | string? | Error message if upload fails |
file | File? | The original File object (undefined for pre-hydrated files) |
Usage Example
1import { type UploadFileItem } from "uplofile";23function FileInfo({ item }: { item: UploadFileItem }) {4 return (5 <div>6 <h3>{item.name}</h3>7 <p>Status: {item.status}</p>8 {item.status === "uploading" && <p>Progress: {item.progress}%</p>}9 {item.status === "error" && <p className="error">Error: {item.error}</p>}10 {item.previewUrl && <img src={item.previewUrl} alt="Preview" />}11 </div>12 );13}