The File Dropzone component for Retool Apps
A drag-and-drop area to select single or multiple files.
Refer to the File inputs guide for more information on how to use this component.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
accept
A list of file extensions or file-type specifiers to accept.
Type | array | ||||
Array values | string | ||||
Mutability |
|
Examples
appendNewSelection
Whether to append additional files to the value.
Type | boolean | ||||
Mutability |
|
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
Array Object Properties
iconBefore
The prefix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
isPublic
Whether to make the file public when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
parseFiles
Whether to parse plain-text content.
Type | boolean | ||||
Mutability |
|
placeholder
The text to display within the input field when there is no value.
Type | string | ||||
Format | string | ||||
Mutability |
| ||||
Default |
|
Examples
selectionType
The type of file selection.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
shouldOverwriteOnNameCollision
Whether to replace a file with the same name when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
style
Custom style options.
Type | object | ||||
Mutability |
|
uploadToRetoolStorage
Whether to upload a file to Retool Storage.
Type | boolean | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
fileDropzone.clearValidation()
Clear the validation message from the input field.
fileDropzone.clearValidation()
Examples
fileDropzone.resetValue()
Reset the current value to the default value.
fileDropzone.resetValue()
Examples
fileDropzone.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
fileDropzone.scrollIntoView(options)
Parameters
Examples
fileDropzone.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
fileDropzone.setDisabled(disabled)
Parameters
Examples
fileDropzone.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
fileDropzone.setHidden(hidden)
Parameters
Examples
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Change | The value is changed. |
Parse | Data is parsed. |