Get started with react-dropzone CDN

MIT licensed

React-dropzone is a popular library for building drag-and-drop file uploads in React applications.

Tags:
  • react-component
  • react
  • drag
  • drop
  • upload
  • file-upload
  • file
  • drag-and-drop

Stable version

Copied!

How to start using react-dropzone CDN


import React from 'react';
import { useDropzone } from 'react-dropzone';

function Dropzone() {
  const { getRootProps, getInputProps, isDragActive } = useDropzone({ accept: 'image/*' });

  return (
    <div {...getRootProps()}>
      <input {...getInputProps()} />
      <p>Drag 'n' drop some files here, or click to select files</p>
      {isDragActive ? (
        <p>Drop the files here ...</p>
      ) : (
        <p>No files chosen yet.</p>
      )}
    </div>
  );
}

export default Dropzone;
Copied!
Copied!

All versions