Compositions
FileUploadDropzone
FileUploadDropzone - A drag-and-drop zone for file uploads. Use with the useFileUpload hook for full functionality.
Usage
Best practices
FileUploadDropzoneis presentational - wire it to theuseFileUploadhook for the actual file input, drag state, and file list; it stores nothing itself.Forward the hook's
handleDragEnter/Leave/Over/Dropand drag state intodraggingso the drag styling matches the real drop-target state.Keep
title/description(accepted types, size limit) accurate - they are the zone's only affordance copy; override the whole body viachildrenwhen needed.
Props
FileUploadDropzone
FileUploadItem
FileUploadList
FileUploadTrigger
Also exports
- interface
FileMetadata - interface
FileUploadActions - interface
FileUploadOptions - interface
FileUploadState - interface
FileWithPreview - const
formatBytes - const
useFileUpload