Dropzone
A drag-and-drop zone for file uploads with visual feedback.
Usage
1import {2 UplofileRoot,3 UplofileDropzone,4 UplofileTrigger,5 UplofilePreview,6} from "@/components/ui/uplofile";78export default function DropzoneDemo() {9 return (10 <UplofileRoot upload={async () => ({ url: "" })}>11 <UplofileDropzone className="border-2 border-dashed p-8 rounded-lg transition-colors data-[dragging=true]:border-primary data-[dragging=true]:bg-primary/5">12 <span>Drop files here or </span>13 <UplofileTrigger className="underline text-blue-500">14 click to browse15 </UplofileTrigger>16 <UplofilePreview />17 </UplofileDropzone>18 </UplofileRoot>19 );20}
Props
| Prop | Type | Description |
|---|---|---|
className | string | Use data attributes like data-dragging for styling |
asChild | boolean | Merge props onto the child element |
...rest | HTMLAttributes | Supports all standard HTML attributes |