1.0.0 • Published 2 years ago

solidjs-dropzone v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Solid DropZone

SolidJS Adapter For React DropZone

Install

pnpm install solidjs-dropzone

Usage

import { useDropzone } from "solidjs-dropzone";

function MyDropzone() {
  const onDrop = (acceptedFiles: File[]) => {
    // Do something with the files
  };
  const { getInputProps, getRootProps, isDragActive } = useDropzone({ onDrop });
  return (
    <div {...getRootProps()}>
      <input {...getInputProps()} />
      {dropzone.isDragActive ? (
        <p>Drop the files here ...</p>
      ) : (
        <p>Drag 'n' drop some files here, or click to select files</p>
      )}
    </div>
  );
}