![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@liara/react-drag-drop-files
Advanced tools
Light React Drag & Drop files and images library styled by styled-components
Light and simple reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
Install it from npm (using NPM).
npm i --save react-drag-drop-files
or:
yarn add react-drag-drop-files
Using react hooks just as simple as:
import React, { useState } from "react";
import { FileUploader } from "react-drag-drop-files";
const fileTypes = ["JPG", "PNG", "GIF"];
function DragDrop() {
const [file, setFile] = useState(null);
const handleChange = (file) => {
setFile(file);
};
return (
<FileUploader handleChange={handleChange} name="file" types={fileTypes} />
);
}
export default DragDrop;
Option | Type | Description | value example |
---|---|---|---|
name | string | the name for your form (if exist) | "myFile" |
label | string | the label (text) for your form (if exist) inside the uploading box - first word underlined | "Upload or drop a file right here" |
disabled | boolean | this for disabled the input | true OR false |
hoverTitle | string | text appears(hover) when trying to drop a file | "Drop here" |
file | file or null | this mainly made because if you would like to remove uploaded file pass null or pass another file as initial | |
classes | string | string with the classes wished to add | "drop_area drop_zone" |
types | Array | array of strings with extentions to check and go throw | ['png', 'jpeg', ...] |
children | JSX Element, any | if you want to replace the current design inside the box of drop zone. (it will remove the default exist style) | <div><p>this is inside drop area</p></div> or just text |
maxSize | number | the maximum size of the file (number in mb) | 2 |
minSize | number | the minimum size of the file (number in mb) | 1 |
onSizeError | function | function that will be called only of error occured related to size min or max | (file) => console.log(file) |
onDrop | function | function that will be called when the user drop a file on the drop area only | (file) => console.log(file) |
onSelect | function | function that will be called when the user select a file on click the file area only | (file) => console.log(file) |
handleChange | function | function that will be called when the user select or drop a file | (file) => console.log(file) |
FAQs
Light React Drag & Drop files and images library styled by styled-components
The npm package @liara/react-drag-drop-files receives a total of 0 weekly downloads. As such, @liara/react-drag-drop-files popularity was classified as not popular.
We found that @liara/react-drag-drop-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.