New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shadcn-dropzone

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shadcn-dropzone

Ready to use File Upload Dropzone component, built with shadcn/ui and react-dropzone.

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
increased by28.54%
Maintainers
0
Weekly downloads
 
Created
Source

Shadcn Dropzone

Ready to use File Upload Dropzone component, built with shadcn/ui and react-dropzone.

Demo: https://diragb.github.io/shadcn-dropzone

Installation

npm install --save shadcn-dropzone

or

yarn add shadcn-dropzone

Usage

import Dropzone from 'shadcn-dropzone';

// Use the default UI
const DefaultUI = () => {
  return (
    <Dropzone
      onDrop={(acceptedFiles: File) => {
        // Do something with the files
      }}
    />
  );
}

// Or, pass a custom UI
const CustomUI = () => {
  return (
    <Dropzone
      onDrop={(acceptedFiles: File) => {
        // Do something with the files
      }}
    >
      {(dropzone: DropzoneState) => (
        <>
          {
            dropzone.isDragAccept ? (
              <div className='text-sm font-medium'>Drop your files here!</div>
            ) : (
              <div className='flex items-center flex-col gap-1.5'>
                <div className='flex items-center flex-row gap-0.5 text-sm font-medium'>
                  Upload files
                </div>
              </div>
            )
          }
          <div className='text-xs text-gray-400 font-medium'>
            { dropzone.acceptedFiles.length } files uploaded so far.
          </div>
        </>
      )}
    </Dropzone>
  )
}

Make sure you have TailwindCSS set up in your project, as this component relies on them.

Props

Check out react-dropzone for all the props.

License

MIT

Keywords

FAQs

Package last updated on 19 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc