Skip to main content

FileDropper

This component is used for files management.

Default

By default, the component accepts an unlimited number of files and gives the ability to remove them.

onAddFiles has been called 0 times

<FileDropper />

Prevent delete

It can sometimes be necessary to prevent the user from removing uploaded files. This is possible by setting the canRemove property to false.

onAddFiles has been called 0 times

<FileDropper canRemove={false} />

No list

You can hide the default list of files with the displayList property to make your own outside of the component.

onAddFiles has been called 0 times

<FileDropper displayList={false} />

Limit

Nombre max. : 0 sur 5

onAddFiles has been called 0 times

<FileDropper
maxFiles={5}
fileTypeAccepted={{
'image/jpeg': [],
'image/png': [],
'application/pdf': []
}}
/>

With files

onAddFiles has been called 0 times

<FileDropper initialFiles={files} />

Props

NameTypeRequiredDefaultDescription
canRemoveboolNotrueIf true, a button is displayed to remove each files. When clicked, the onRemoveFile function is called with the file as uniq argument.
displayListboolNotrueIf true, the list of files is displayed.
initialFilesarrayYesThe list of files.
filesListTitlestringNoText to display as the title of the file list.
maxFilesnumberNoIs used to limit the number of files.
fileTypeAcceptedobjectNois Used to limit type of files.
onAddFilesfuncNoFunction called when the component receives files.
onChangefuncNoFunction called when the files list changes.
onRemoveFilefuncNoFunction called when a file is removed.