Rxova
Skip to content

UseFileInputOptions

optional accept?: string;

Comma-separated accept string, exactly as <input accept> takes it: extensions (.png), full types (image/png), and wildcards (image/*).

FileRules.accept


optional announce?: (event) => string;
ParameterType
event{ added?: number; files: File[]; rejected?: FileAttempt[]; type: "add" | "remove" | "reject"; }
event.added?number
event.filesFile[]
event.rejected?FileAttempt[]
event.type"add" | "remove" | "reject"

string


optional dedupe?: boolean;

Treat two files with the same name, size and timestamp as the same file.

true

FileRules.dedupe


optional defaultValue?: File[];

optional disabled?: boolean;

optional id?: string;

optional maxFiles?: number;

Maximum number of files.

FileRules.maxFiles


optional maxSize?: number;

Largest allowed file, in bytes.

FileRules.maxSize


optional minSize?: number;

Smallest allowed file, in bytes. Catches the 0-byte file a failed copy leaves behind.

FileRules.minSize


optional multiple?: boolean;

optional onAdd?: (file, files) => void;
ParameterType
fileFile
filesFile[]

void


optional onBlur?: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


optional onChange?: (files) => void;
ParameterType
filesFile[]

void


optional onFocus?: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


optional onReject?: (attempt) => void;
ParameterType
attemptFileAttempt

void


optional onRemove?: (file, index, files) => void;
ParameterType
fileFile
indexnumber
filesFile[]

void


optional onWarn?: (warning) => void;
ParameterType
warningFileWarning

void


optional previews?: boolean;

optional readOnly?: boolean;

optional validate?: (file, existing) => string | boolean;

Final say. Return true, false, or a string explaining the refusal.

ParameterType
fileFile
existingFile[]

string | boolean

FileRules.validate


optional value?: File[];