FileInput()function

FileInput({
	name,
	title,
	placeholder = title,
	required = false,
	disabled = false,
	message,
	// value,
	onValue,
	types = {},
	capture,
	className,
	...variants
}: FileInputProps): ReactElement
ParamType
variantsFileInputProps
Props for FileInput, an <input type="file"> that emits the selected File. required
    .typesFileTypes
The file types the picker accepts.
    .captureFileCapture
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 types dictionary restricts the picker's accepted file types.
  • The optional capture opens the front ("user") or back ("environment") camera straight away.

Examples

<FileInput name="avatar" types={{ png: "image/png" }} onValue={setFile} />