Skip to content
R

react-dropzone

Simple HTML5 drag-drop zone with React.js

by rolandjitsuFree

#12in UI Libraries
0In stores

Description

react-dropzone is a simple React hook and wrapper component for building an HTML5 drag-and-drop zone that accepts files. You can use the use…

Highlights

  • React hook and Dropzone wrapper component
  • Installs from npm with TypeScript types
  • Works with Vite, webpack and Rspack
  • Props getters and a refKey option
  • Guidance for testing with react-testing-library

Ratings & Reviews

No ratings yet

Be the first to rate react-dropzone.

People also visit

R

react-mui-dropzone

A Material-UI-v5 file-upload dropzone

UI Libraries
Launch
F

@files-ui/react

UI components for file uploads with React js

UI Libraries
Launch
R

react-magic-dropzone

Magically drag and drop files/links, built for React

UI Libraries
Launch
M

material-ui-dropzone

A Material-UI file-upload dropzone

UI Libraries
Launch
M

mui-file-dropzone

A Material-UI file-upload dropzone. Written in TypeScript

UI Libraries
Launch
R

React Uploady

Modern file uploading - components & hooks for React

Utilities
Launch

react-dropzone FAQ

What does react-dropzone do?

It creates a drag-and-drop zone in a React app that accepts files, using the HTML5 drag-and-drop events.

How do I install it?

Install react-dropzone from npm. It ships with TypeScript types and works with modern bundlers.

How do I open the file dialog?

Bind the props from getInputProps to an input element, or use the Dropzone component's open method. Without the input, opening the dialog will not work.

How do I read the file contents?

Use the FileReader API on the files the dropzone returns, as shown in the README.

How do I test components that use it?

The README recommends react-testing-library, because some drag callbacks are asynchronous.

Where is the documentation?

At react-dropzone.js.org, with the source on GitHub.

What are the best react-dropzone alternatives?

Popular alternatives to react-dropzone include react-mui-dropzone, @files-ui/react and react-magic-dropzone. See all react-dropzone alternatives

Developer Stuff

Badges