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
["image/*", "pdf", "doc"]
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
true
events
A list of configured event handlers that trigger actions or queries.
Type | array | ||||
Array values | object | ||||
Mutability |
|
Array Object Properties
event
The event that triggers the action. Refer to the events section for details of available events for this object.
Type | string | ||||
Mutability |
|
method
The JavaScript method to perform when type
is datasource
, widget
, state
, or localStorage
.
Type | string | ||||
Mutability |
|
type
The type of action to perform.
Type | string | ||||||||||||||
Mutability |
| ||||||||||||||
Allowed Values |
|
Array Object Properties
Examples
1617024000000
iconBefore
The prefix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
/icon:bold/shopping-gift
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
top
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
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
Enter a value
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
Clear the validation message from fileDropzone
.
fileDropzone.clearValidation();
fileDropzone.clearValue()
Clear the current values.
fileDropzone.clearValue()
Examples
Clear the current value of fileDropzone
.
fileDropzone.clearValue();
fileDropzone.focus()
Set focus on the input field.
fileDropzone.focus()
Examples
Set focus on fileDropzone
.
fileDropzone.focus();
fileDropzone.resetValue()
Reset the current value to the default value.
fileDropzone.resetValue()
Examples
Reset the current value of fileDropzone
.
fileDropzone.resetValue();
fileDropzone.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
fileDropzone.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring fileDropzone
into view.
fileDropzone.scrollIntoView({behavior: 'auto', block: 'nearest'});
fileDropzone.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
fileDropzone.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable fileDropzone
.
fileDropzone.setDisabled(true);
Enable fileDropzone
.
fileDropzone.setDisabled(false);
fileDropzone.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
fileDropzone.setHidden(hidden)
Parameters
Examples
true
Examples
Hide fileDropzone
.
fileDropzone.setHidden(true);
Unhide fileDropzone
.
fileDropzone.setHidden(false);
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. |