DropZone
Last updated
Last updated
accept
An array of strings that specifies what extensions the user can include.
NOTE: Do not include the dot in front of the extension.
label
Text displayed above the dropzone area.
limit
The number of files that can be selected. There is a hard limit of 10 as the maximum.
noun
If provided, replaces the word "files" in the component.
onDrop
Callback function that is called whenever a user selects or unselects a file.
tooltip
Text that appears when hovering over the component.
validationError
When provided, outlines the component in a red error state, and displays the value to the user as red text.
value
A File[]
that can be used to reorder and remove the selected files from the component.
To deselect all files, set it to an empty array.
NOTE: You cannot add a file to the selection through this interface.
DropZones give users that ability to upload a file, and a way for you to receive them. Any uploads can be passed back by the onDrop
function as a File[]
which is an internal Olive Helps type that provides a built in readFile()
function.
The below example illustrates what some of the different properties change the rendering of the component when provided.