1.0.0 • Published 12 months ago

solidjs-dropzone v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months 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>
  );
}
1.0.0

12 months ago