EDS4 logo
@eds/file-input
v4.1.2

FileInput

An input to select one or more files to upload.
Prop
Required
Description
Type
onChange

The OnChange handler for when the whole value changes.

(setState: (currentValue: InputFile[]) => InputFile[]) => void | Promise<void>
onDrop

The handler for the array of files that have changed. NOTE - This is not the entire values array, just the files that have changed.

(files: InputFile[]) => Promise<InputFile[]>
onDelete

The handler for when a file should be deleted.

(file: InputFile) => void
value

The controlled value of the component. Defaults to [].

InputFile[]
maxFileCount

The maximum number of files the user can upload.

number
maxFileSize

The maximum file size allowed for each file in bytes. Defaults to 10000000.

number
acceptedFileTypes

The accepted file types the user can upload. @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

string[]
disabled

Whether the component is disabled.

boolean
invalid

Whether the component is invalid.

boolean
children

The file input should not have any children.

never