Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mantine/dropzone

Package Overview
Dependencies
Maintainers
1
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mantine/dropzone

Dropzone component built with Mantine theme and components

  • 7.14.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80K
increased by50.01%
Maintainers
1
Weekly downloads
 
Created

What is @mantine/dropzone?

@mantine/dropzone is a React component library that provides a customizable and easy-to-use file dropzone for uploading files. It is part of the Mantine UI library, which offers a wide range of components for building modern web applications. The dropzone component allows users to drag and drop files or click to select files for upload, with support for file type restrictions, previews, and more.

What are @mantine/dropzone's main functionalities?

Basic File Dropzone

This feature allows you to create a basic file dropzone where users can drag and drop files or click to select files. The `onDrop` callback is triggered with the selected files.

import { Dropzone } from '@mantine/dropzone';

function Demo() {
  return (
    <Dropzone onDrop={(files) => console.log(files)}>
      {(status) => <div>Drop files here</div>}
    </Dropzone>
  );
}

File Type Restrictions

This feature allows you to restrict the types of files that can be uploaded. In this example, only PNG and JPEG images are accepted.

import { Dropzone } from '@mantine/dropzone';

function Demo() {
  return (
    <Dropzone onDrop={(files) => console.log(files)} accept={['image/png', 'image/jpeg']}>
      {(status) => <div>Drop images here</div>}
    </Dropzone>
  );
}

File Previews

This feature provides a way to display previews of the uploaded files. The example shows how to render image previews for the accepted files.

import { Dropzone } from '@mantine/dropzone';

function Demo() {
  return (
    <Dropzone onDrop={(files) => console.log(files)}>
      {(status) => (
        <div>
          {status.acceptedFiles.map((file) => (
            <img key={file.name} src={URL.createObjectURL(file)} alt={file.name} width={100} />
          ))}
        </div>
      )}
    </Dropzone>
  );
}

Other packages similar to @mantine/dropzone

Keywords

FAQs

Package last updated on 28 Nov 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