FileUploaderField
Example
Props
Name | Type | Default Value | Required | Description |
---|---|---|---|---|
texts | FileUploaderTexts | Yes | Texts used in the component | |
renderIssue | (issue: E | ErrorCode, file?: File) => Children | Yes | A function to render validation issues. It's used to display a user-friendly error message under the field. | |
issues | NonEmptyArray<E> | No | A non-empty array of validation issues for the field | |
maxFileSize | number | No | The maximum size of uploaded files, in megabytes. | |
allowedFileTypes | Record<string, string[]> | No | An object where the keys are MIME types and the values are file extensions. | |
validate | (file: File) => Promise<E> | async () => null | No | Custom validation function.
If the function returns an error code, the file is considered invalid.
Returning |
height | string | number | No | The field height | |
isUploading | boolean | No | A parameter that allows external control of the uploading status. | |
label | string | Yes | ||
disabled | boolean | No | ||
hintPlacement |
| No | ||
autoFocus | boolean | No | ||
onBlur | () => unknown | No | ||
name | string | No | ||
value | FileResult<E> | Yes | ||
onChange | (value: FileResult<E>) => unknown | Yes | ||
hint | string | No |