useFileDialog

Open the file dialog of the browser from any element and get the chosen files.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Choose images and list their names.

APIs

useFileDialog

const useFileDialog = (options?: {
  multiple?: boolean
  accept?: string
  capture?: string
  onChange?: (files: FileList | null) => void
}) => {
  files: FileList | null
  open: () => void
  reset: () => void
}
Edit this page on GitHub