1.0.0 • Published 4 months ago

@soorria/solid-dropzone v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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.0

4 months ago

0.0.6

4 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago