1.0.1 • Published 11 months ago

@soorria/solid-dropzone v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

solid-dropzone

pnpm

Drag and drop file input library for SolidJS.

Note: This is a SolidJS port of react-dropzone

Quick start

Install it:

npm i @soorria/solid-dropzone
# or
yarn add @soorria/solid-dropzone
# or
pnpm add @soorria/solid-dropzone

Use it:

import { createDropzone } from '@soorria/solid-dropzone'

Example

Adapted from the first example here: https://github.com/react-dropzone/react-dropzone/#usage

import { createDropzone } from '@soorria/solid-dropzone'

function MyDropzone() {
  const onDrop = (acceptedFiles: File[]) => {
    // Do something with the files
  }
  const dropzone = createDropzone({ onDrop })

  return (
    <div {...dropzone.getRootProps()}>
      <input {...dropzone.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.1

11 months ago

1.0.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago