Skip to main content

File Input

The File Input component lets users select files from their device using a compact input field with a Browse button. Unlike the File Picker, it does not include a drag-and-drop zone — it is designed for inline form use where a familiar, button-triggered file selection is preferred.

Example Usage

A procurement team builds an internal expense management tool where employees submit reimbursement requests. The form includes a File Input component so users can attach receipts by clicking Browse, selecting one or more files, and submitting. The component enforces a 5 MB max file size and accepts only PDFs and images, preventing invalid uploads before they reach the backend.

Properties

Data

Property
Description
Expected Value
LabelText displayed as the field label.String (e.g., Attach Receipt).
PlaceholderHint text shown in the input area when no file is selected.String (e.g., Click to select file).
Allow uploading multiple filesAllows the user to select more than one file at a time.Toggle (default: enabled).
Enable clear selectionShows a clear (×) button inside the input area to remove the selected file(s).Toggle (default: disabled).
Enable parsingParses the file content and makes it available as structured data.Toggle (default: disabled).
File typeWhen Enable parsing is on, specifies how the file is parsed.Select — Autodetect from extension, CSV, Microsoft Excel – xls, Microsoft Excel – xlsx, JSON (default: Autodetect from extension).

Events

EventDescription
On File SelectedTriggers when the user selects one or more files from the file dialog.
On File LoadedTriggers when a selected file finishes loading in the browser.
info

Check Action Reference docs to get detailed information about all the Actions.

Component Specific Actions (CSA)

The following actions can be controlled using component-specific actions (CSA), triggered via an event or a RunJS query.

Action
Description
How To Access
clear()Clears the currently selected file(s).components.fileinput1.clear()
setFocus()Moves focus to the file input component.components.fileinput1.setFocus()
setBlur()Removes focus from the file input component.components.fileinput1.setBlur()
setVisibility()Shows or hides the component.components.fileinput1.setVisibility(false)
setDisable()Enables or disables the component.components.fileinput1.setDisable(true)
setLoading()Sets the loading state of the component.components.fileinput1.setLoading(true)

Exposed Variables

Variable
Description
How To Access
filesArray of file objects selected by the user. Each object includes the file name, content, and metadata.{{components.fileinput1.files}}
isParsingIndicates whether file content is currently being parsed.{{components.fileinput1.isParsing}}
isValidIndicates whether the selected file(s) pass all validation rules.{{components.fileinput1.isValid}}
fileSizeThe size of the selected file in bytes.{{components.fileinput1.fileSize}}
isMandatoryIndicates whether the field is marked as mandatory.{{components.fileinput1.isMandatory}}
isLoadingIndicates whether the component is in a loading state.{{components.fileinput1.isLoading}}
isVisibleIndicates whether the component is currently visible.{{components.fileinput1.isVisible}}
isDisabledIndicates whether the component is currently disabled.{{components.fileinput1.isDisabled}}

Validation

Validation Option
Description
Expected Value
Mark as mandatoryDisplays a validation error if no file is selected on form submission.Toggle (default: disabled).
File typeRestricts accepted file types using MIME types or extensions.String (e.g., image/*, .pdf, */*). Default: */*.
Min size (Bytes)The minimum allowed file size in bytes.Number (default: 50).
Max size (Bytes)The maximum allowed file size in bytes.Number (default: 51200000, ~51 MB).
Min filesThe minimum number of files required. Only shown when Allow uploading multiple files is enabled.Number (default: 0).
Max filesThe maximum number of files the user can select. Only shown when Allow uploading multiple files is enabled.Number (default: 2).
info

File types must be valid MIME types or file extensions. MIME type detection may vary across platforms — for example, CSV files are reported as text/plain on macOS and application/vnd.ms-excel on Windows.

Additional Actions

Action
Description
Configuration Options
Loading stateEnables a loading spinner, often used with isLoading to indicate progress.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
VisibilityControls component visibility.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
DisableEnables or disables the component.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
TooltipProvides additional information on hover. Set a string value for display.String (e.g., Upload your expense receipt here.).

Devices

Property
Description
Expected Value
Show on desktopMakes the component visible in desktop view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Show on mobileMakes the component visible in mobile view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Styles

Label

Property
Description
Configuration Options
ColorSets the label text color.Select a theme color or pick from the color picker.
AlignmentControls whether the label appears above (Top) or beside (Side) the input field.Switch — Top (default) / Side.
DirectionWhen alignment is Side, positions the label to the left or right of the input.Icon toggle — Left (default) / Right.
WidthWhen alignment is Side, determines whether the label width adjusts automatically or uses a fixed value.Checkbox — Auto (default). Uncheck to set a custom width.
Label widthSets a fixed width for the label. Only available when Side alignment is selected and Auto width is unchecked.Slider (percentage of component width).
Width typeSpecifies whether the label width is measured relative to the whole component or just the input field. Only available when Side alignment is selected and Auto width is unchecked.Select — Of the Component (default) / Of the Field.

Field

Property
Description
Configuration Options
IconSets the icon displayed in the Browse button. Toggle the visibility switch to show or hide the icon, and set the icon color using the color picker.Icon selector with visibility toggle and color picker.
BackgroundSets the background color of the input field.Select a theme color or pick from the color picker.
BorderSets the border color of the input field.Select a theme color or pick from the color picker.
AccentSets the accent color used for interactive elements such as the Browse button.Select a theme color or pick from the color picker.
TextSets the color of the selected file name text.Select a theme color or pick from the color picker.
Error textSets the color of validation error messages displayed below the field.Select a theme color or pick from the color picker.
Border radiusRounds the corners of the input field.Number (default: 6). Enter a value or click fx to set it programmatically.
Box shadowAdds a shadow effect around the input field.Set shadow color and properties, or configure programmatically with fx.

Container

Property
Description
Configuration Options
PaddingControls the internal padding of the component.Switch (Default / None).


Need Help?