1.0.0 • Published 2 years ago
solidjs-dropzone v1.0.0
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
2 years ago