--- title: "File Upload" slug: file-upload category: component type: overview version: 20.0.0 tokens: 563 source: https://ovh.github.io/design-system/v20.0.0/llms/react-components-file-upload.txt --- # File Upload _**File Upload** allows users to select one or more files to upload to a specific location._ ## Props | Property | Type | Required | Default | Description | |---|---|---|---|---| | `accept` | `string` | No | undefined | The accepted file types. | | `acceptedFileLabel` | `string` | No | undefined | Label describing the accepted file types. | | `disabled` | `boolean` | No | undefined | Whether the component is disabled. | | `dropzoneLabel` | `string` | No | undefined | The dropzone label. | | `error` | `string` | No | undefined | The global error message to display. | | `invalid` | `boolean` | No | undefined | Whether the component is in error state. | | `locale` | `'fr' | 'de' | 'en' | 'es' | 'it' | 'nl' | 'pl' | 'pt'` | No | undefined | The locale used for the translation of the internal elements. | | `maxFile` | `number` | No | undefined | The maximum number of files that can be selected. | | `maxFileLabel` | `string` | No | undefined | Label describing the maximum number of files that can be selected. | | `maxSize` | `number` | No | undefined | The maximum size of selectable files. | | `maxSizeLabel` | `string` | No | undefined | Label describing the maximum size of selectable files. | | `name` | `string` | No | undefined | The name of the form element. Useful for form submission. | | `onFileAccept` | `(detail: FileUploadAcceptDetail) => void` | No | undefined | Callback fired when a some files have been successfully added. | | `onFileReject` | `(detail: FileUploadRejectDetail) => void` | No | undefined | Callback fired when a some files have been rejected. | | `required` | `boolean` | No | undefined | Whether the component is required. | | `triggerLabel` | `string` | No | undefined | Upload button label. | | `variant` | `'default' | 'compact'` | No | undefined | The variant preset to use. | ## Examples - Default - Compact - Disabled - Custom Labels - Accept - Max File - Max Size - Upload - In Form Field - Accessibility File Button - Accessibility Form Field ## Documentation pages - [Documentation](./react-components-file-upload--documentation.txt) - [Technical Information](./react-components-file-upload--technical-information.txt) - [Examples](./react-components-file-upload--examples.txt)