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.
Glisser les documents ici
ou
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
.
Glisser les documents ici
ou
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.
Glisser les documents ici
ou
onAddFiles has been called 0 times
<FileDropper displayList={false} />
Limit
Glisser les documents ici
ou
Nombre max. : 0 sur 5
onAddFiles has been called 0 times
<FileDropper
maxFiles={5}
fileTypeAccepted={{
'image/jpeg': [],
'image/png': [],
'application/pdf': []
}}
/>
With files
Glisser les documents ici
ou
onAddFiles has been called 0 times
<FileDropper initialFiles={files} />
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
canRemove | bool | No | true | If true , a button is displayed to remove each files. When clicked, the onRemoveFile function is called with the file as uniq argument. |
displayList | bool | No | true | If true , the list of files is displayed. |
initialFiles | array | Yes | The list of files. | |
filesListTitle | string | No | Text to display as the title of the file list. | |
maxFiles | number | No | Is used to limit the number of files. | |
fileTypeAccepted | object | No | is Used to limit type of files. | |
onAddFiles | func | No | Function called when the component receives files. | |
onChange | func | No | Function called when the files list changes. | |
onRemoveFile | func | No | Function called when a file is removed. |