> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: FilePicker Component

## Article: FilePicker Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/form/file-picker-component.md

## Article Content:

# FilePicker

_Components/Form/FilePicker_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/filepicker>

## Overview

```jsx
<FilePicker />;
```

The file picker allows users to upload a single file at a time. The component handles the file upload via the native file browser dialog, the validation and preview of an uploaded file.

### Do

- Use it to upload text or media file
- Use it to upload single file at a time

### Don't

- Don't use it if you need to upload multiple files at once, use `<FileUpload/>` instead.

### Feature examples

#### Structure

File upload consists of two labels: \`mainLabel\` for action text and \`subLabel\` for a description.

```jsx
<FilePicker
  mainLabel="Main Action Label"
  subLabel="Supportive label or description"
/>;
```

#### Supported formats

Define file types that could be uploaded with the \`supportedFormats\` prop. Separate formats with a comma.

```jsx
<FilePicker supportedFormats=".png, .pdf" />;
```

#### Max size

Define the maximum file size for an upload with the \`maxSize\` prop.

```jsx
<FilePicker maxSize={8000000} subLabel="No file chosen (Max size 8MB)" />;
```

#### Error message

Describe an error status by using the \`errorMessage\` prop. Messages will only be revealed when the \`error\` status is \`true\`.

```jsx
<FilePicker
  supportedFormats=".png, .pdf"
  error
  errorMessage="Failed to upload. File is too large."
/>;
```

#### Header

Add text or any other component in an area above the component using the \`header\` prop.

```jsx
<FilePicker
  header={
    <StorybookComponents.Placeholder>Header</StorybookComponents.Placeholder>
  }
/>;
```

## Code

```jsx
import { FilePicker } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in tests. |
| `error` | `boolean` | — | Defines if an error should show or not. |
| `errorMessage` | `string` | `''` | Sets an error message to display. |
| `header` | `ReactNode` | — | Allows to insert overline text at the top left of a component. Can also be overridden with any other component, i.e. <Image/>. |
| `id` | `string \| number` | — | Specifies a unique id for the element. |
| `mainLabel` | `string` | `'Choose File'` | Sets the main action label. |
| `maxSize` | `number` | `5000000` | Defines the maximum size of a file that can be uploaded. |
| `name` | `string` | — | Defines a name for inner input. |
| `onChange` | `(file: File) => void` | — | Defines a standard input onChange callback. |
| `subLabel` | `string` | `'No file chosen (Max size 5 MB)'` | Adds a supportive message below the action title. |
| `supportedFormats` | `string` | `'*'` | Defines which file types to accept (i.e. .jpeg, .gif, .png). Formats should be separated by a comma. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { FilePickerUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { FilePickerTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { FilePickerTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { FilePickerTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `hasError` | Checks whether there's a visible error icon |
| `errorMessage` | Gets error message text |
| `getSubLabel` | Gets sub label text |
| `getMainLabel` | Gets main label text |
| `getName` | Gets FilePicker input name |
| `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. |

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.329.0** (2026-09-24) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.278.0** (2026-05-08) — maintenance release, no component-specific changes
- **1.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — fix: roundness of FilePicker (tokenization) ([#15976](invalid-url))
- **1.242.0** (2025-12-19) — maintenance release, no component-specific changes
- **1.183.0** (2025-04-24) — fix: error message now wraps instead of ellipsis and doesn't have max-width ([#14762](invalid-url))
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes