{"name":"react-dropzone","version":"18.0.2","keywords":["drag","drop","react","react-component","upload"],"author":{"name":"Param Aggarwal"},"license":"MIT","_id":"react-dropzone@18.0.2","maintainers":[{"name":"rolandjitsu","email":"rolandjitsu@gmail.com"},{"name":"okonet","email":"andrey@okonet.dev"},{"name":"rxmarbles","email":"rmarkins@gmail.com"}],"contributors":[{"url":"http://okonet.ru","name":"Andrey Okonetchnikov","email":"andrey@okonet.ru"},{"name":"Mike Olson","email":"me@mwolson.org"},{"name":"Param Aggarwal"},{"name":"Tyler Waters","email":"tyler.waters@gmail.com"},{"name":"Rick Markins","email":"rmarkins@gmail.com"},{"name":"Roland Groza","email":"rolandjitsu@gmail.com"}],"homepage":"https://github.com/react-dropzone/react-dropzone","bugs":{"url":"https://github.com/react-dropzone/react-dropzone/issues"},"dist":{"shasum":"17c8d70e9cbba3416a91e0302b6a98821abcd737","tarball":"http://registry-npm.ywwl.com/react-dropzone/download/react-dropzone-18.0.2.tgz","fileCount":11,"integrity":"sha512-KyUA3yeNVMAk+nlMGhvYrq+FeXg9ClpCcU3gvELV7iHW5OWiLnTskBcNthlT7OutRJmpMMvK8cTRI+zqtjrlGw==","signatures":[{"sig":"MEYCIQCr3hrbKgdk2nnLwCrp6OHovxiTBrAAE76ngT9YzfDOagIhAMJ8qNdxDTTe5xYLpzi2qzZ8KTTYPWEcTIC0UwSakFGh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/react-dropzone@18.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":212569,"size":47268,"noattachment":false,"key":"/react-dropzone/-/react-dropzone-18.0.2.tgz"},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">= 20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"51e9af23b3d5ffb595fcba8b6b0952e2bdd805d7","scripts":{"dev":"tsdown --watch","lint":"oxlint","test":"vitest","build":"tsdown","clean":"rm -rf dist","format":"oxfmt .","prepare":"prek install || exit 0","docs:dev":"vocs dev","lint:fix":"oxlint --fix","prebuild":"npm run clean","test:cov":"vitest run --coverage","hooks:run":"prek run --all-files","docs:build":"vocs build","type-check":"tsc --noEmit && tsc --noEmit -p tsconfig.type-tests.json","pretest:cov":"npm run type-check && npm run lint && npm run format:check","docs:preview":"vocs preview","format:check":"oxfmt --check .","hooks:install":"prek install","lint:type-aware":"oxlint --type-aware"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:afac1619-b853-434b-9438-d15a85037e26"}},"repository":{"url":"git+https://github.com/react-dropzone/react-dropzone.git","type":"git"},"_npmVersion":"11.18.0","description":"Simple HTML5 drag-drop zone with React.js","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"attr-accept":"^2.2.5","file-selector":"^4.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vocs":"^2.5.3","waku":"^1.0.0-beta.6","jsdom":"^29.1.1","oxfmt":"^0.58.0","react":"^19.0.0","oxlint":"^1.73.0","tsdown":"^0.22.4","vitest":"^4.1.10","react-dom":"^19.0.0","typescript":"^7.0.2","@types/node":"^26.1.1","@types/react":"^19.0.0","oxlint-tsgolint":"^0.24.0","@types/react-dom":"^19.0.0","semantic-release":"^25.0.2","styled-components":"^6.4.3","@vitest/coverage-v8":"^4.1.10","@testing-library/dom":"^10.0.0","@semantic-release/npm":"^13.1.3","@testing-library/react":"^16.3.2","@semantic-release/github":"^10.0.0","@testing-library/jest-dom":"^6.0.0","@semantic-release/changelog":"^6.0.0","@semantic-release/commit-analyzer":"^12.0.0","@semantic-release/release-notes-generator":"^14.1.0"},"peerDependencies":{"react":">= 18","@types/react":"*"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-dropzone_18.0.2_1784357424131_0.4421296428304773","host":"s3://npm-registry-packages-npm-production"},"readme":"<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/react-dropzone/.github/main/brand/assets/logo.png\" alt=\"react-dropzone logo\" width=\"120\" />\n</p>\n\n# react-dropzone\n\n[![npm](https://img.shields.io/npm/v/react-dropzone.svg?style=flat-square)](https://www.npmjs.com/package/react-dropzone)\n![Tests](https://img.shields.io/github/actions/workflow/status/react-dropzone/react-dropzone/test.yml?branch=master&style=flat-square&label=tests)\n[![coverage](https://img.shields.io/coveralls/github/react-dropzone/react-dropzone/master?style=flat-square)](https://coveralls.io/github/react-dropzone/react-dropzone?branch=master)\n[![Open Collective Backers](https://img.shields.io/opencollective/backers/react-dropzone.svg?style=flat-square)](#backers)\n[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/react-dropzone.svg?style=flat-square)](#sponsors)\n[![Gitpod](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/react-dropzone/react-dropzone)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=flat-square)](https://github.com/react-dropzone/.github/blob/main/CODE_OF_CONDUCT.md)\n\nSimple React hook to create a HTML5-compliant drag'n'drop zone for files.\n\nDocumentation and examples at https://react-dropzone.js.org. Source code at https://github.com/react-dropzone/react-dropzone/.\n\n## Installation\n\nInstall it from npm. `react-dropzone` ships as ESM and CommonJS with TypeScript types included, and works with any modern bundler ([Vite](https://vite.dev/), [webpack](https://webpack.js.org/), [Rspack](https://rspack.rs/), etc.).\n\n```bash\nnpm install react-dropzone\n```\n\nor:\n\n```bash\nyarn add react-dropzone\n```\n\n## Usage\n\nYou can either use the hook:\n\n```jsx static\nimport React, {useCallback} from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const onDrop = useCallback(acceptedFiles => {\n    // Do something with the files\n  }, []);\n  const {getRootProps, getInputProps, isDragActive} = useDropzone({onDrop});\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      {isDragActive ? <p>Drop the files here ...</p> : <p>Drag 'n' drop some files here, or click to select files</p>}\n    </div>\n  );\n}\n```\n\nOr the wrapper component for the hook:\n\n```jsx static\nimport React from \"react\";\nimport Dropzone from \"react-dropzone\";\n\n<Dropzone onDrop={acceptedFiles => console.log(acceptedFiles)}>\n  {({getRootProps, getInputProps}) => (\n    <section>\n      <div {...getRootProps()}>\n        <input {...getInputProps()} />\n        <p>Drag 'n' drop some files here, or click to select files</p>\n      </div>\n    </section>\n  )}\n</Dropzone>;\n```\n\nIf you want to access file contents you have to use the [FileReader API](https://developer.mozilla.org/en-US/docs/Web/API/FileReader):\n\n```jsx static\nimport React, {useCallback} from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const onDrop = useCallback(acceptedFiles => {\n    acceptedFiles.forEach(file => {\n      const reader = new FileReader();\n\n      reader.onabort = () => console.log(\"file reading was aborted\");\n      reader.onerror = () => console.log(\"file reading has failed\");\n      reader.onload = () => {\n        // Do whatever you want with the file contents\n        const binaryStr = reader.result;\n        console.log(binaryStr);\n      };\n      reader.readAsArrayBuffer(file);\n    });\n  }, []);\n  const {getRootProps, getInputProps} = useDropzone({onDrop});\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop some files here, or click to select files</p>\n    </div>\n  );\n}\n```\n\n## Dropzone Props Getters\n\nThe dropzone property getters are just two functions that return objects with properties which you need to use to create the drag 'n' drop zone.\nThe root properties can be applied to whatever element you want, whereas the input properties must be applied to an `<input>`:\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const {getRootProps, getInputProps} = useDropzone();\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop some files here, or click to select files</p>\n    </div>\n  );\n}\n```\n\nNote that whatever other props you want to add to the element where the props from `getRootProps()` are set, you should always pass them through that function rather than applying them on the element itself.\nThis is in order to avoid your props being overridden (or overriding the props returned by `getRootProps()`):\n\n```jsx static\n<div\n  {...getRootProps({\n    onClick: event => console.log(event),\n    role: \"button\",\n    \"aria-label\": \"drag and drop area\"\n    // ...and any other props\n  })}\n/>\n```\n\nIn the example above, the provided `{onClick}` handler will be invoked before the internal one, therefore, internal callbacks can be prevented by simply using [stopPropagation](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation).\nSee [Events](https://react-dropzone.js.org#events) for more examples.\n\n_Important_: if you omit rendering an `<input>` and/or binding the props from `getInputProps()`, opening a file dialog will not be possible.\n\n## Refs\n\nBoth `getRootProps` and `getInputProps` accept a custom `refKey` (defaults to `ref`) as one of the attributes passed down in the parameter.\n\nThis can be useful when the element you're trying to apply the props from either one of those fns does not expose a reference to the element, e.g:\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n// NOTE: After v4.0.0, styled components exposes a ref using forwardRef,\n// therefore, no need for using innerRef as refKey\nimport styled from \"styled-components\";\n\nconst StyledDiv = styled.div`\n  // Some styling here\n`;\nfunction Example() {\n  const {getRootProps, getInputProps} = useDropzone();\n  return (\n    <StyledDiv {...getRootProps({refKey: \"innerRef\"})}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop some files here, or click to select files</p>\n    </StyledDiv>\n  );\n}\n```\n\nIf you're working with [Material UI v4](https://v4.mui.com/) and would like to apply the root props on some component that does not expose a ref, use [RootRef](https://v4.mui.com/api/root-ref/):\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\nimport RootRef from \"@material-ui/core/RootRef\";\n\nfunction PaperDropzone() {\n  const {getRootProps, getInputProps} = useDropzone();\n  const {ref, ...rootProps} = getRootProps();\n\n  return (\n    <RootRef rootRef={ref}>\n      <Paper {...rootProps}>\n        <input {...getInputProps()} />\n        <p>Drag 'n' drop some files here, or click to select files</p>\n      </Paper>\n    </RootRef>\n  );\n}\n```\n\n**IMPORTANT**: do not set the `ref` prop on the elements where `getRootProps()`/`getInputProps()` props are set, instead, get the refs from the hook itself:\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction Refs() {\n  const {\n    getRootProps,\n    getInputProps,\n    rootRef, // Ref to the `<div>`\n    inputRef // Ref to the `<input>`\n  } = useDropzone();\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop some files here, or click to select files</p>\n    </div>\n  );\n}\n```\n\nIf you're using the `<Dropzone>` component, though, you can set the `ref` prop on the component itself which will expose the `{open}` prop that can be used to open the file dialog programmatically:\n\n```jsx static\nimport React, {createRef} from \"react\";\nimport Dropzone from \"react-dropzone\";\n\nconst dropzoneRef = createRef();\n\n<Dropzone ref={dropzoneRef}>\n  {({getRootProps, getInputProps}) => (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop some files here, or click to select files</p>\n    </div>\n  )}\n</Dropzone>;\n\ndropzoneRef.open();\n```\n\n## Testing\n\n`react-dropzone` makes some of its drag 'n' drop callbacks asynchronous to enable promise based `getFilesFromEvent()` functions. In order to test components that use this library, you need to use the [react-testing-library](https://github.com/testing-library/react-testing-library):\n\n```js static\nimport React from \"react\";\nimport Dropzone from \"react-dropzone\";\nimport {act, fireEvent, render} from \"@testing-library/react\";\n\ntest(\"invoke onDragEnter when dragenter event occurs\", async () => {\n  const file = new File([JSON.stringify({ping: true})], \"ping.json\", {type: \"application/json\"});\n  const data = mockData([file]);\n  const onDragEnter = jest.fn();\n\n  const ui = (\n    <Dropzone onDragEnter={onDragEnter}>\n      {({getRootProps, getInputProps}) => (\n        <div {...getRootProps()}>\n          <input {...getInputProps()} />\n        </div>\n      )}\n    </Dropzone>\n  );\n  const {container} = render(ui);\n\n  await act(() => fireEvent.dragEnter(container.querySelector(\"div\"), data));\n  expect(onDragEnter).toHaveBeenCalled();\n});\n\nfunction mockData(files) {\n  return {\n    dataTransfer: {\n      files,\n      items: files.map(file => ({\n        kind: \"file\",\n        type: file.type,\n        getAsFile: () => file\n      })),\n      types: [\"Files\"]\n    }\n  };\n}\n```\n\n**NOTE**: using [Enzyme](https://airbnb.io/enzyme) for testing is not supported at the moment, see [#2011](https://github.com/airbnb/enzyme/issues/2011).\n\nMore examples for this can be found in `react-dropzone`'s own [test suites](https://github.com/react-dropzone/react-dropzone/blob/master/src/index.spec.tsx).\n\n## Caveats\n\n### Required React Version\n\nReact [18](https://react.dev/blog/2022/03/29/react-v18) or above is required because we use [hooks](https://react.dev/reference/react/hooks) (the lib itself is a hook).\n\n### File Paths\n\nFiles returned by the hook or passed as arg to the `onDrop` cb won't have the properties `path` or `fullPath`.\nFor more inf check [this SO question](https://stackoverflow.com/a/23005925/2275818) and [this issue](https://github.com/react-dropzone/react-dropzone/issues/477).\n\n### Tauri (and other native webviews)\n\nInside a [Tauri](https://tauri.app/) webview, OS file drops are intercepted by the native window layer before the webview sees them, so the browser's drag 'n' drop events never fire and the dropzone appears to ignore drops. Disable Tauri's native handling to let `react-dropzone` work unchanged: set `dragDropEnabled: false` (Tauri v2) or `fileDropEnabled: false` (Tauri v1) in `tauri.conf.json`. If you instead need the absolute paths of dropped files, keep native handling on and drive your own state from Tauri's drag-drop event. See the [Using with Tauri](https://react-dropzone.js.org/guide/tauri) guide and [#1316](https://github.com/react-dropzone/react-dropzone/issues/1316).\n\n### Not a File Uploader\n\nThis lib is not a file uploader; as such, it does not process files or provide any way to make HTTP requests to some server; if you're looking for that, checkout [filepond](https://pqina.nl/filepond) or [uppy.io](https://uppy.io/).\n\n### Paste to Upload\n\nPasting files into the dropzone is supported out of the box: when the dropzone (or a focused child, e.g. a `<textarea>`) has focus and the user pastes files with <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>V</kbd> - for instance a screenshot copied to the clipboard - those files run through the same `accept`, size and `validator` checks and the same `onDrop`/`onDropAccepted`/`onDropRejected` callbacks as a drop. Pastes that carry no files (plain text and the like) are ignored and left untouched, so pasting into inputs keeps working.\n\nThe paste is only received when the dropzone has focus, so pair it with [`autoFocus`](https://react-dropzone.js.org) or let the user click/tab into it first. To disable paste handling, set `noPaste`:\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const {getRootProps, getInputProps} = useDropzone({noPaste: true});\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <p>Drag 'n' drop or click - pasting is disabled</p>\n    </div>\n  );\n}\n```\n\n### Using \\<label\\> as Root\n\nIf you use [\\<label\\>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label) as the root element, the file dialog will be opened twice; see [#1107](https://github.com/react-dropzone/react-dropzone/issues/1107) and [#1432](https://github.com/react-dropzone/react-dropzone/issues/1432) why. A `<label>` natively forwards clicks to the `<input>` it wraps, so the dialog opens once from that and once from our own click handler. To avoid this, use `noClick`:\n\n```jsx static\nimport React, {useCallback} from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const {getRootProps, getInputProps} = useDropzone({noClick: true});\n\n  return (\n    <label {...getRootProps()}>\n      <input {...getInputProps()} />\n    </label>\n  );\n}\n```\n\n### Using open() on Click\n\nIf you bind a click event on an inner element and use `open()`, it will trigger a click on the root element too, resulting in the file dialog opening twice. To prevent this, use the `noClick` on the root:\n\n```jsx static\nimport React, {useCallback} from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone() {\n  const {getRootProps, getInputProps, open} = useDropzone({noClick: true});\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <button type=\"button\" onClick={open}>\n        Open\n      </button>\n    </div>\n  );\n}\n```\n\n### Changing Props Before open()\n\nBrowsers only let you open the file dialog from within a short window after a user gesture (a \"[transient user activation](https://developer.mozilla.org/en-US/docs/Web/Security/User_activation)\"). Because of this, `open()` must run synchronously in the same event that the user triggered - it cannot wait for React to re-render.\n\nSo if you update a prop (e.g. `accept`) and call `open()` in the same handler, `open()` runs against the _previous_ render, before the new prop is applied. Some browsers (notably Safari) may also drop the file dialog entirely, so it appears to require a second click. See [#1188](https://github.com/react-dropzone/react-dropzone/issues/1188).\n\n```jsx static\n// 🚫 open() runs with the old `accept` - and may not open at all on Safari\nfunction MyDropzone() {\n  const [accept, setAccept] = useState({\"image/*\": []});\n  const {getRootProps, getInputProps, open} = useDropzone({accept, noClick: true});\n\n  const pickPdfs = () => {\n    setAccept({\"application/pdf\": []}); // applied on the next render\n    open(); // still uses {\"image/*\": []}\n  };\n\n  return (\n    <div {...getRootProps()}>\n      <input {...getInputProps()} />\n      <button type=\"button\" onClick={pickPdfs}>\n        Pick PDFs\n      </button>\n    </div>\n  );\n}\n```\n\nInstead, render one dropzone per set of props (each with its own `open`) and call the right one, so no state change has to land before opening:\n\n```jsx static\nfunction MyDropzone() {\n  const images = useDropzone({accept: {\"image/*\": []}, noClick: true});\n  const pdfs = useDropzone({accept: {\"application/pdf\": []}, noClick: true});\n\n  return (\n    <div {...images.getRootProps()}>\n      <input {...images.getInputProps()} />\n      <input {...pdfs.getInputProps()} />\n      <button type=\"button\" onClick={images.open}>\n        Pick images\n      </button>\n      <button type=\"button\" onClick={pdfs.open}>\n        Pick PDFs\n      </button>\n    </div>\n  );\n}\n```\n\n### Camera Option Missing on Android\n\nOn Android 13+, Chrome and Edge open the native [Android photo picker](https://developer.android.com/training/data-storage/shared/photopicker) whenever a file input's `accept` attribute resolves to _only_ image and/or video types (e.g. `accept={{\"image/*\": []}}`). That picker only lists the gallery and files - it has no \"take a photo\"/camera action - so the camera appears to be missing. See [#1417](https://github.com/react-dropzone/react-dropzone/issues/1417).\n\nThis is browser/OS behavior, not something the lib controls, and it's unrelated to how the `<input>` is styled: a plain `<input type=\"file\">` with no `accept` (or one that also allows a non-media type) falls back to the older chooser that _does_ include the Camera app.\n\nIf you need the camera, use the [`capture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#capture) attribute, which you can pass straight through `getInputProps()`:\n\n```jsx static\n// Camera only (no gallery/files)\n<input {...getInputProps({capture: \"environment\"})} />\n```\n\nTo offer both the camera and the gallery, render one dropzone per input (each with its own `open`) and let the user pick which one to trigger:\n\n```jsx static\nimport React from \"react\";\nimport {useDropzone} from \"react-dropzone\";\n\nfunction MyDropzone({onDrop}) {\n  const gallery = useDropzone({accept: {\"image/*\": []}, noClick: true, onDrop});\n  const camera = useDropzone({accept: {\"image/*\": []}, noClick: true, onDrop});\n\n  return (\n    <>\n      <button type=\"button\" onClick={gallery.open}>\n        Choose from gallery\n      </button>\n      <input {...gallery.getInputProps()} />\n\n      <button type=\"button\" onClick={camera.open}>\n        Take a photo\n      </button>\n      <input {...camera.getInputProps({capture: \"environment\"})} />\n    </>\n  );\n}\n```\n\n### File Dialog Cancel Callback\n\nThe `onFileDialogCancel()` cb is unstable in most browsers, meaning, there's a good chance of it being triggered even though you have selected files.\n\nWe rely on using a timeout of `300ms` after the window is focused (the window `onfocus` event is triggered when the file select dialog is closed) to check if any files were selected and trigger `onFileDialogCancel` if none were selected.\n\nAs one can imagine, this doesn't really work if there's a lot of files or large files as by the time we trigger the check, the browser is still processing the files and no `onchange` events are triggered yet on the input. Check [#1031](https://github.com/react-dropzone/react-dropzone/issues/1031) for more info.\n\nFortunately, there's the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API), which is currently a working draft and some browsers support it (see [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker#browser_compatibility)), that provides a reliable way to prompt the user for file selection and capture cancellation.\n\nAlso keep in mind that the FS access API can only be used in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).\n\n**NOTE** You can enable using the FS access API with the `useFsAccessApi` property: `useDropzone({useFsAccessApi: true})`.\n\n### File System Access API\n\nWhen setting `useFsAccessApi` to `true`, you're switching to the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API) (see the [file system access](https://wicg.github.io/file-system-access/) RFC).\n\nWhat this essentially does is that it will use the [showOpenFilePicker](https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker) method to open the file picker window so that the user can select files.\n\nIn contrast, the traditional way (when the `useFsAccessApi` is not set to `true` or not specified) uses an `<input type=\"file\">` (see [docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file)) on which a click event is triggered.\n\nWith the use of the file system access API enabled, there's a couple of caveats to keep in mind:\n\n1. The users will not be able to select directories\n2. It requires the app to run in a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts)\n3. In [Electron](https://www.electronjs.org/), the path may not be set (see [#1249](https://github.com/react-dropzone/react-dropzone/issues/1249))\n4. Some browsers/configurations block `showOpenFilePicker()` and reject with a `NotAllowedError` (e.g. Microsoft Edge for Business or other restrictive enterprise/security policies). When this happens we automatically fall back to the native `<input>` so the file dialog still opens, provided you render one via `getInputProps()` (see [#1429](https://github.com/react-dropzone/react-dropzone/issues/1429))\n\n## Supported Browsers\n\nWe use [browserslist](https://github.com/browserslist/browserslist) config to state the browser support for this lib, so check it out on [browserslist.dev](https://browserslist.dev/?q=ZGVmYXVsdHM%3D).\n\n## Need image editing?\n\nReact Dropzone integrates perfectly with [Pintura Image Editor](https://pqina.nl/pintura/?ref=react-dropzone), creating a modern image editing experience. Pintura supports crop aspect ratios, resizing, rotating, cropping, annotating, filtering, and much more.\n\nCheckout the [Pintura integration example](https://codesandbox.io/s/react-dropzone-pintura-40xh4?file=/src/App.js).\n\n## Support\n\n### Backers\n\nSupport us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/react-dropzone#backer)]\n\n<a href=\"https://opencollective.com/react-dropzone/backer/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/backer/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/backer/29/avatar.svg\"></a>\n\n### Sponsors\n\nBecome a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/react-dropzone#sponsor)]\n\n<a href=\"https://opencollective.com/react-dropzone/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/react-dropzone/sponsor/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/react-dropzone/sponsor/29/avatar.svg\"></a>\n\n### Hosting\n\n[react-dropzone.js.org](https://react-dropzone.js.org/) hosting provided by [netlify](https://www.netlify.com/).\n\n## Contribute\n\nCheckout the organization [CONTRIBUTING.md](https://github.com/react-dropzone/.github/blob/main/CONTRIBUTING.md).\n\n## License\n\nMIT\n","publish_time":1784357424268,"_cnpm_publish_time":1784357424268,"dist-tags":{"latest":"20.2.0"}}