The Uploader component handles file selection.
It uses react-dropzone under the hood.
It must reference an Uploader component to find files to upload.
This component extends React.ComponentPropsWithoutRef<"div">, meaning it accepts all native div element props.
acceptFor example: {"image/*": [".png", ".gif", ".jpeg", ".jpg"]}
Type: {[key: string]: string[]}
asChildType: boolean
disabledType: boolean
hideIfMaxFilesReachedHides the uploader if the maximum number of files has been reached.
Also hides it, if a single file is selected and multiple is set to false.
Type: boolean
nameA unique name for this uploader. Allows other components like Queue and UploadButton to reference this uploader.
Type: string
Required
noDropPrevents the user from dropping files into the uploader.
Type: boolean
noClickPrevents the user from clicking the uploader to select files.
Type: boolean
maxFilesType: number
maxSizeType: number
Default: 2.5e8 (250 MB)
multipleAllows selection of multiple files.
Type: boolean
Default: true
onProgressA function to be called whenever a file's upload progress changes.
Type: (progress: number) => void
onUploadA function to be called whenever a file from the queue is uploaded.
You can access the raw response data from the provider upload endpoint.
Type: (file: unknown) => void
onSuccessA function to be called when all files of the queue are uploaded successfully.
Comes with an array of all uploaded files (raw response data from provider upload endpoint).
Type: (files: unknown[]) => void
onErrorA function to be called when an error occurs during file upload.
Type: (message: string) => void
uploadPathDefault path this uploader will upload files to.
Type: string
isDragActiveIt is recommended to use the DropIndicator component to conditionally
render elements based on drag status.
Type: boolean
Uploader must be used inside a Root component.