UX Engineered Upload Flow
<input type="file"> by addressing five distinct user feedback signals.- Drag Feedback: The dropzone reacts physically (glow, border shift, icon scale) to drag events.
- Honest Progress: Replaces mystery spinners with exact percentage tracking, dynamic time estimations, and file metadata.
- Inline Retry: Files that fail mid-upload do not reset. They halt their state, turn red, and offer an inline 1-click retry button to resume.
- Upload Preview: Extracts visual proof (thumbnails) of the file instantly on the client side before upload completes.
- Independent Queue: Every file gets its own lane and state. One failure never blocks the others.
Dropzone that hands you File[], and an UploadItem that renders one entry of your own queue state. Drop real files into the first preview — its simulator randomly fails some at 89% so you can watch the inline retry resume.Dropzone + UploadItem suite, the Input block's built-in file mode for simple forms, and the Folder block as a playful drop target. Each section below ends with its own install.Dropzone and upload queue
Dropzone that hands you File[], and an UploadItem for each row of your own queue state.Dropzone
- Use
accept - with a native input accept string such as
"image/*,application/pdf"to restrict types. maxSize{50}- is the limit in megabytes, and is echoed in the helper text automatically.
Upload states
status- drives the whole row —
idle,uploading,paused,errorandsuccesseach pick their own colours, icon and messaging. onRetry- is what the inline Retry button calls after an
error;onRemovebacks the X.
Install the upload suite
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Install Upload
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Upload needs only the cn helper and lucide-react, which the installation guide already put in place.
UploadItem renders fine without it.Simple file input
Input block has a file mode with previews and removal built in. It has no dependency on the upload suite.Simple file input
For a form that just needs files attached: the Input block in file mode, with previews and removal built in.
- Set
type"file" - on
InputBlockto turn the field into a drag-and-drop zone with previews. onFilesChange- returns native
File[]on drop, selection and removal. multiple- and
acceptpass through;accepttakes the standard HTML string such as"image/*".
Install the input block
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Install Input
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Input needs only the cn helper and lucide-react, which the installation guide already put in place.
Folder drop target
Folder block as an upload surface — a playful alternative to a dropzone for a handful of files.Folder drop target
The Folder block as an upload surface, tinted with the theme colour: drop files on it or click to browse. It starts empty, each dropped file becomes a card with its own progress bar, the pocket tracks the overall figure, and an × removes a file.
- Set
interactive - to enable drag-and-drop and click-to-browse.
onFilesreceives the dropped or pickedFile[];acceptandmultiplepass through to the input. peek{0}- keeps the folder empty until the first drop — without it the folder shows three placeholder cards peeking out.
progress- drives the bar across the pocket (0–100); a per-file
progressdraws a bar on that card.onRemoveFileadds an × to each fanned card. color- defaults to a soft tint of
--primary(lightness 0.88, chroma at 40%), so the folder — body, pocket, icon and the peeking cards — follows your theme preset and the colour picker above without going heavy. Pass any CSS colour to pin one.
Install the folder block
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Two builds, same props and file — install one.
Install Folder
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Step 1 installs these for you. Run them yourself only if you are adding Folder to an existing project by hand. The cn helper and lucide-react are not listed — the installation guide covers them once for every component.
tooltip is a component, not a package — the shadcn CLI installs it as source files.
gsap is an npm package.
Features
Fluid Animations
Hardware-accelerated transitions that ensure smooth 60fps performance across devices.
Highly Customizable
Exposes intuitive props for tailoring colors, sizes, and animation speeds to fit your brand.
Responsive Design
Automatically adapts to mobile, tablet, and desktop viewports without horizontal scrolling issues.
Accessible
Built with semantic HTML and ARIA labels where necessary to support screen readers and keyboard navigation.
Best Practices & Guidelines
Animation Performance
Avoid placing too many heavy animated components on a single screen to prevent layout thrashing and maintain 60fps performance. Use intersection observers to pause off-screen animations.
State Management
When triggering animations via state changes, ensure you wrap state updates in startTransition or use lightweight stores to prevent React rendering bottlenecks during the animation tick.
Props Reference
| Component / Interface | Prop | Type | Default | Description |
|---|---|---|---|---|
Dropzone | onFilesDrop | (files: File[]) => void | Required | Callback function triggered when the user successfully drops files
into the zone or selects them via the native file browser. |
Dropzone | maxSize | number | 50 | The maximum allowed file size in Megabytes (MB). Displayed dynamically
in the helper text. |
Dropzone | accept | string | undefined | Native HTML input accept string restricting file types (e.g.,
"image/*,application/pdf"). |
UploadItem | item | FileUploadState | Required | The data object tracking the specific file's progress, status, and
metadata. |
UploadItem | onRetry | (id: string) => void | undefined | Callback fired when the user clicks the inline "Retry" button after a
file fails to upload. |
UploadItem | onRemove | (id: string) => void | undefined | Callback fired when the user clicks the "X" button to cancel an upload
or clear a completed file from the queue. |
FileUploadState | status | "idle" | "uploading" | "paused" | "error" | "success" | Required | The core state machine parameter that drives the UI colors, icons, and
messaging for the specific upload item. |
InputBlock | type | "file" | "text" | Switches the Input block into the drag-and-drop zone shown in the
simple file input example. |
InputBlock | onFilesChange | (files: File[]) => void | undefined | Fired when files are dropped, selected, or removed, with the current
native File[]. |
InputBlock | multiple / accept | boolean / string | false / undefined | Allow several files, and restrict types with the standard HTML accept
string (e.g. "image/*"). |
FileUploadState | previewUrl | string | undefined | Optional local Blob URL used to render instant client-side image
thumbnails before the upload completes. |