# FileUploadProps (@salmonui/inputs/file-upload)

> The FileUploadProps interface of @salmonui/inputs/file-upload.

Canonical: https://salmonui.dev/docs/reference/inputs/file-upload/FileUploadProps

```ts
import type { FileUploadProps } from '@salmonui/inputs/file-upload';
```

Entry index: https://salmonui.dev/docs/reference/inputs/file-upload (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/file-upload.md).

## Reference

Kind: interface

```ts
interface FileUploadProps extends FieldCommonProps, NativeInput {
    readonly files?: readonly (FileEntry | FilePreload)[] | undefined;
    readonly defaultFiles?: readonly (FileEntry | FilePreload)[] | undefined;
    readonly onFilesChange?: ((files: readonly FileEntry[], details: FilesChangeDetails) => void) | undefined;
    readonly accept?: string | undefined;
    readonly multiple?: boolean | undefined;
    readonly directory?: boolean | undefined;
    readonly minSize?: number | undefined;
    readonly maxSize?: number | undefined;
    readonly maxFiles?: number | undefined;
    readonly upload?: UploadTransport | undefined;
    readonly remove?: RemoveTransport | undefined;
    readonly autoUpload?: boolean | undefined;
    readonly concurrency?: number | undefined;
    readonly dropTarget?: RefObject<Element | null> | undefined;
    readonly dropEffect?: 'copy' | 'move' | 'link' | 'none' | undefined;
    readonly showFileList?: boolean | undefined;
    readonly renderFile?: ((ctx: FileRenderContext) => ReactNode) | undefined;
    readonly renderTrigger?: ((ctx: {
        readonly open: () => void;
        readonly text: string;
    }) => ReactNode) | undefined;
    readonly localeText?: FileUploadLocaleText | undefined;
    readonly locale?: string | undefined;
    readonly onBeforeFilesAdd?: ((event: BeforeFilesAddEvent) => void) | undefined;
    readonly onBeforeUpload?: ((event: BeforeFileEvent) => void) | undefined;
    readonly onUploadProgress?: ((file: FileEntry) => void) | undefined;
    readonly onUploadSuccess?: ((file: FileEntry, result: unknown) => void) | undefined;
    readonly onUploadError?: ((file: FileEntry, reason: unknown) => void) | undefined;
    readonly onUploadComplete?: ((files: readonly FileEntry[]) => void) | undefined;
    readonly onBeforeRemove?: ((event: BeforeFileEvent) => void) | undefined;
    readonly onBeforeClear?: ((event: BeforeClearEvent) => void) | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly classNames?: {
        readonly trigger?: string;
        readonly list?: string;
        readonly item?: string;
        readonly label?: string;
        readonly description?: string;
        readonly error?: string;
    } | undefined;
    readonly ref?: Ref<FileUploadApi> | undefined;
}
```

Members (39):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `label` | `label?: ReactNode;` | optional, inherited |  |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) \| ReactNode;` | optional, inherited | Error text (or a function of the errors) shown while the field is invalid. |
| `invalid` | `invalid?: boolean;` | optional, inherited | Forces the error state. |
| `validation` | `validation?: FieldValidation;` | optional, inherited | Rules in the Data Grid vocabulary. |
| `validateOn` | `validateOn?: ValidateOn;` | optional, inherited | When errors appear; default the `Form`'s, else `'blur'`. |
| `size` | `size?: FieldSize;` | optional, inherited | Metric set. Default `'md'`. |
| `files` | `readonly files?: readonly (FileEntry \| FilePreload)[] \| undefined;` | optional | Controlled list; preloaded entries default to status `'uploaded'`. |
| `defaultFiles` | `readonly defaultFiles?: readonly (FileEntry \| FilePreload)[] \| undefined;` | optional |  |
| `onFilesChange` | `readonly onFilesChange?: ((files: readonly FileEntry[], details: FilesChangeDetails) => void) \| undefined;` | optional |  |
| `accept` | `readonly accept?: string \| undefined;` | optional | Extensions and MIME types (`'.pdf,image/*'`); other files are `invalid` with error `type`. |
| `multiple` | `readonly multiple?: boolean \| undefined;` | optional |  |
| `directory` | `readonly directory?: boolean \| undefined;` | optional | Picks and drops folders (`webkitdirectory`, drops walked recursively). |
| `minSize` | `readonly minSize?: number \| undefined;` | optional | Bytes; smaller files get error `tooSmall`. |
| `maxSize` | `readonly maxSize?: number \| undefined;` | optional | Bytes; larger files get error `tooLarge`. |
| `maxFiles` | `readonly maxFiles?: number \| undefined;` | optional | Files beyond the limit get error `tooMany`. |
| `upload` | `readonly upload?: UploadTransport \| undefined;` | optional | Transport; without it the files only submit with the form. |
| `remove` | `readonly remove?: RemoveTransport \| undefined;` | optional | Server removal of uploaded files. |
| `autoUpload` | `readonly autoUpload?: boolean \| undefined;` | optional | Uploads as soon as files are added. Default `true`. |
| `concurrency` | `readonly concurrency?: number \| undefined;` | optional | Parallel uploads; `1` is sequential. Default unlimited. |
| `dropTarget` | `readonly dropTarget?: RefObject<Element \| null> \| undefined;` | optional | Another element that accepts drops. |
| `dropEffect` | `readonly dropEffect?: 'copy' \| 'move' \| 'link' \| 'none' \| undefined;` | optional | `dataTransfer.dropEffect` while dragging over; `'none'` refuses drops. Default `'copy'`. |
| `showFileList` | `readonly showFileList?: boolean \| undefined;` | optional | Default `true`. |
| `renderFile` | `readonly renderFile?: ((ctx: FileRenderContext) => ReactNode) \| undefined;` | optional | Content of one list item. |
| `renderTrigger` | `readonly renderTrigger?: ((ctx: {     readonly open: () => void;     readonly text: string; }) => ReactNode) \| undefined;` | optional | Content of the drop zone button. |
| `localeText` | `readonly localeText?: FileUploadLocaleText \| undefined;` | optional |  |
| `locale` | `readonly locale?: string \| undefined;` | optional | Locale of file sizes. Default `'en-US'`. |
| `onBeforeFilesAdd` | `readonly onBeforeFilesAdd?: ((event: BeforeFilesAddEvent) => void) \| undefined;` | optional |  |
| `onBeforeUpload` | `readonly onBeforeUpload?: ((event: BeforeFileEvent) => void) \| undefined;` | optional |  |
| `onUploadProgress` | `readonly onUploadProgress?: ((file: FileEntry) => void) \| undefined;` | optional |  |
| `onUploadSuccess` | `readonly onUploadSuccess?: ((file: FileEntry, result: unknown) => void) \| undefined;` | optional |  |
| `onUploadError` | `readonly onUploadError?: ((file: FileEntry, reason: unknown) => void) \| undefined;` | optional |  |
| `onUploadComplete` | `readonly onUploadComplete?: ((files: readonly FileEntry[]) => void) \| undefined;` | optional |  |
| `onBeforeRemove` | `readonly onBeforeRemove?: ((event: BeforeFileEvent) => void) \| undefined;` | optional |  |
| `onBeforeClear` | `readonly onBeforeClear?: ((event: BeforeClearEvent) => void) \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: {     readonly trigger?: string;     readonly list?: string;     readonly item?: string;     readonly label?: string;     readonly description?: string;     readonly error?: string; } \| undefined;` | optional | Part classes: `trigger`, `list`, `item`, `label`, `description`, `error`. |
| `ref` | `readonly ref?: Ref<FileUploadApi> \| undefined;` | optional |  |
