Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/fileupload
File upload allows users to upload one or multiple files at once. This wrapper opens a native upload dialog box when the user clicks a trigger.
<AddItem/>.<FilePicker/> instead.A trigger component must be added, so that users can open the upload dialog box. This trigger is defined as a child item of FileUpload.
Select which types of files can be uploaded with the accept prop. The file types are separated by a comma.
Let users upload multiple files at once using the multiple prop.
capture tells FileUpload to open a device camera flow (mobile) instead of a regular picker.
"user" (default) opens the front-facing camera."environment" opens the rear-facing camera."none" disables camera capture and uses the regular file picker.Desktop always opens the standard file picker.
Any library component can be used to open an upload dialog box. Nevertheless, it's better to use buttons or viewer components that have predefined interaction states and can be accessed with the keyboard (for accessibility reasons).
To let users add images, set <ImageViewer/> as the trigger component.
Let users attach files to messages, emails or contact details with the <Button/> or <TextButton/> components.
| Name | Type | Default | Description |
|---|---|---|---|
accept | string | — | Defines which file types to accept (i.e. .jpeg, .gif, .png). Each format should be separated by a comma. |
capture | "none" | "user" | "environment" | user | Specifies that a new file should be captured and which camera to use to capture the image or video data. Use user for the user-facing camera and environment for the outward-facing camera. ##### Note: This only works on mobile devices; If your device is a desktop computer, you'll get a standard file picker. |
children (required) | (params: FileUploadChildrenProps) => ReactNode | — | Accepts any kind of component as a child item that calls out the file picker. ##### Syntax: function({ openFileUpload }): element * openFileUpload: A function that opens a file upload dialog when triggered. * return: A react element |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in tests. |
multiple | boolean | false | Allows you to select and upload multiple files at once. |
name | string | — | Specifies a form data name to be submitted along with the control value. |
onChange (required) | (files: FileList | null) => void | — | Defines a standard input onChange callback. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
Last updated: 22 October 2026