UseFileInputOptions
Extends
Section titled “Extends”Properties
Section titled “Properties”accept?
Section titled “accept?”accept?: string;Comma-separated accept string, exactly as <input accept> takes it:
extensions (.png), full types (image/png), and wildcards (image/*).
Inherited from
Section titled “Inherited from”announce?
Section titled “announce?”announce?: (event) => string;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | { added?: number; files: File[]; rejected?: FileRejected[]; type: "add" | "remove" | "reject"; } |
event.added? | number |
event.files | File[] |
event.rejected? | FileRejected[] |
event.type | "add" | "remove" | "reject" |
Returns
Section titled “Returns”string
dedupe?
Section titled “dedupe?”dedupe?: boolean;Treat two files with the same name, size and timestamp as the same file.
Default
Section titled “Default”trueInherited from
Section titled “Inherited from”defaultValue?
Section titled “defaultValue?”defaultValue?: File[];disabled?
Section titled “disabled?”disabled?: boolean;id?: string;maxFiles?
Section titled “maxFiles?”maxFiles?: number;Maximum number of files.
Inherited from
Section titled “Inherited from”maxSize?
Section titled “maxSize?”maxSize?: number;Largest allowed file, in bytes.
Inherited from
Section titled “Inherited from”minSize?
Section titled “minSize?”minSize?: number;Smallest allowed file, in bytes. Catches the 0-byte file a failed copy leaves behind.
Inherited from
Section titled “Inherited from”multiple?
Section titled “multiple?”multiple?: boolean;onAdd?
Section titled “onAdd?”onAdd?: (file, files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
files | File[] |
Returns
Section titled “Returns”void
onBlur?
Section titled “onBlur?”onBlur?: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
onChange?
Section titled “onChange?”onChange?: (files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
files | File[] |
Returns
Section titled “Returns”void
onFocus?
Section titled “onFocus?”onFocus?: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
onReject?
Section titled “onReject?”onReject?: (attempt) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attempt | FileRejected |
Returns
Section titled “Returns”void
onRemove?
Section titled “onRemove?”onRemove?: (file, index, files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
index | number |
files | File[] |
Returns
Section titled “Returns”void
onWarn?
Section titled “onWarn?”onWarn?: (warning) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
warning | FileWarning |
Returns
Section titled “Returns”void
previews?
Section titled “previews?”previews?: boolean;readOnly?
Section titled “readOnly?”readOnly?: boolean;validate?
Section titled “validate?”validate?: (file, existing) => string | boolean;Final say. Return true, false, or a string explaining the refusal.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
existing | File[] |
Returns
Section titled “Returns”string | boolean
Inherited from
Section titled “Inherited from”value?
Section titled “value?”value?: File[];