FileInput()function
FileInput({
name,
title,
placeholder = title,
required = false,
disabled = false,
message,
// value,
onValue,
types = {},
capture,
className,
...variants
}: FileInputProps): ReactElement| Param | Type | |
|---|---|---|
variants | FileInputProps | Props for FileInput, an <input type="file"> that emits the selected File. required |
.types | FileTypes | The file types the picker accepts. |
.capture | FileCapture | Which camera the picker opens straight away. On phones this skips the photo library. |
| Return | |
|---|---|
ReactElement | A native <input type="file"> element. |
File picker input that emits the selected File through onValue.
- The optional
typesdictionary restricts the picker's accepted file types. - The optional
captureopens the front ("user") or back ("environment") camera straight away.
Examples
<FileInput name="avatar" types={{ png: "image/png" }} onValue={setFile} />