https://github.com/orjdev/solid-dropzone
React Dropzone Adapter For SolidJS
https://github.com/orjdev/solid-dropzone
Last synced: 9 months ago
JSON representation
React Dropzone Adapter For SolidJS
- Host: GitHub
- URL: https://github.com/orjdev/solid-dropzone
- Owner: OrJDev
- Created: 2023-05-06T16:56:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-17T17:35:43.000Z (over 2 years ago)
- Last Synced: 2025-06-27T02:40:54.061Z (12 months ago)
- Language: TypeScript
- Size: 34.2 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solid DropZone
SolidJS Adapter For React DropZone
### Info
I was working on a SolidJS adapter for UploadThing, noticed it was using React DropZone so I was looking for a SolidJS DropZone adapter and faced an issue with the existing one where it was not working and threw an error (attr-etc is not installed), so i copied the code of it and made a few changes to make it work + used my own build config. The repo [is here](https://github.com/soorria/solid-dropzone) so thanks to the original author.
## Install
```sh
pnpm install solidjs-dropzone
```
## Usage
```tsx
import { createDropzone } from "solidjs-dropzone";
function MyDropzone() {
const onDrop = (acceptedFiles: File[]) => {
// Do something with the files
};
const { getInputProps, getRootProps, isDragActive } = createDropzone({
onDrop,
});
return (
{isDragActive ? (
Drop the files here ...
) : (
Drag 'n' drop some files here, or click to select files
)}
);
}
```