File Input Component
File Inputs are common form controls that allows the user to select files from their local file system. This node roughly corresponds to the HTML input element that has a file type.
Properties
Visible
| Prop | isVisible |
|---|---|
| Type | boolean |
| Default | true |
Whether or not this node is visible.
Enabled
| Prop | isEnabled |
|---|---|
| Type | boolean |
| Default | true |
Whether or not this node is enabled.
Tooltip
| Prop | tooltip |
|---|---|
| Type | string |
| Default | undefined |
The tooltip text to display when hovered or focused over this node.
Top
| Prop | top |
|---|---|
| Type | number |
| Default | 1 |
The position of the node from the top side of the grid (grid-row-start).
Left
| Prop | left |
|---|---|
| Type | number |
| Default | 1 |
The position of the node from the left side of the grid (grid-column-start).
Width
| Prop | width |
|---|---|
| Type | string |
| Default | 384px |
The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4 will become grid-column-end: span 4). When this node is in a stack layout, the width can be specified using CSS units (e.g. 100px or 100%), or be left unitless to be treated as flex-grow for the node.
Min Width
| Prop | minWidth |
|---|---|
| Type | string |
| Default | undefined |
The minimum width of the node. When this node is in a grid layout, this property is ignored.
Max Width
| Prop | maxWidth |
|---|---|
| Type | string |
| Default | undefined |
The maximum width of the node. When this node is in a grid layout, this property is ignored.
Height
| Prop | height |
|---|---|
| Type | string |
| Default | 160px |
The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4 will become grid-row-end: span 4). When this node is in a stack layout, the height can be specified using CSS units (e.g. 100px or 100%), or be left unitless to be treated as flex-grow for the node.
Min Height
| Prop | minHeight |
|---|---|
| Type | string |
| Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Max Height
| Prop | maxHeight |
|---|---|
| Type | string |
| Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Overflow
| Prop | overflow |
|---|---|
| Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
| Default | auto |
The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.
Overflow X
| Prop | overflowX |
|---|---|
| Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
| Default | auto |
The strategy used to handle overflow in the horizontal axis for content that is larger than its container.
Overflow Y
| Prop | overflowY |
|---|---|
| Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
| Default | auto |
The strategy used to handle overflow in the vertical axis for content that is larger than its container.
Custom Styles
| Prop | styles |
|---|---|
| Type | string |
| Default | ::component { } |
Custom CSS styles to be applied to the node. Use element.styles to refer to the current node.
Object Fit
| Prop | objectFit |
|---|---|
| Type | ObjectFit ('none' | 'contain' | 'cover' | 'fill' | 'scale-down') |
| Default | cover |
The strategy used to set how the content of a replaced element should be resized to fit its container.
Field Name
| Prop | formFieldName |
|---|---|
| Type | string |
| Default | undefined |
Defines the key for this input in the body of the submitted form.
Files
| Prop | files |
|---|---|
| Type | Array<{ name: string, type: string, parsedFile: string, size: number }> |
| Default | undefined |
The upload expression to display.
Selection Label
| Prop | selectLabel |
|---|---|
| Type | string |
| Default | Select |
The text to display over file selector.
Upload Icon
| Prop | selectIcon |
|---|---|
| Type | string |
| Default | UploadIcon |
The icon to display on the left side of the file selector.
File Type
| Prop | fileTypeFilter |
|---|---|
| Type | FileType ('image/*' | 'audio/*' | 'video/*' | '') |
| Default | undefined |
The type of file to allow the user to select.
Previews
| Prop | enablePreview |
|---|---|
| Type | boolean |
| Default | false |
Toggle to display the preview images
Multiple Files
| Prop | multiSelect |
|---|---|
| Type | boolean |
| Default | true |
Allow users to select multiple files from directory
Drag & Drop
| Prop | draggable |
|---|---|
| Type | boolean |
| Default | false |
Allow users to drag files from directory
Limit Amount
| Prop | fileCountLimit |
|---|---|
| Type | string |
| Default | unlimited |
Restrict number of files user can upload
Max File Size
| Prop | maxFileSize |
|---|---|
| Type | number |
| Default | 5 |
Restrict total size of files user can upload
Event Handlers
On Hover
| Handler | fileInputNode.onHover |
|---|
Called when the user hovers on the node. Use this event to trigger downstream actions when this node is hovered.
On Leave
| Handler | fileInputNode.onLeave |
|---|
Called when the user is not hovering over the node. Use this event to trigger downstream actions when this node is no longer hovered.
On Focus
| Handler | fileInputNode.onFocus |
|---|
Called when the user focuses the node. Use this event to trigger downstream actions when this node is focused.
On Blur
| Handler | fileInputNode.onBlur |
|---|
Called when the user blurs the node. Use this event to trigger downstream actions when this node is blurred.
On Change
| Handler | fileInputNode.onChange |
|---|
Called after the user selects their files. Use this event to trigger downstream actions when user makes a file selection.