react-dropzone
- Version 14.3.5
- Published
- 567 kB
- 3 dependencies
- MIT license
Install
npm i react-dropzone
yarn add react-dropzone
pnpm add react-dropzone
Overview
Simple HTML5 drag-drop zone with React.js
Index
Functions
function Dropzone
Dropzone: ( props: DropzoneProps & React.RefAttributes<DropzoneRef>) => JSX.Element;
function useDropzone
useDropzone: (options?: DropzoneOptions) => DropzoneState;
Interfaces
interface Accept
interface Accept {}
index signature
[key: string]: readonly string[];
interface DropzoneInputProps
interface DropzoneInputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
property refKey
refKey?: string;
interface DropzoneProps
interface DropzoneProps extends DropzoneOptions {}
method children
children: (state: DropzoneState) => JSX.Element;
interface DropzoneRef
interface DropzoneRef {}
property open
open: () => void;
interface DropzoneRootProps
interface DropzoneRootProps extends React.HTMLAttributes<HTMLElement> {}
property refKey
refKey?: string;
index signature
[key: string]: any;
interface FileError
interface FileError {}
interface FileRejection
interface FileRejection {}
Enums
enum ErrorCode
enum ErrorCode { FileInvalidType = 'file-invalid-type', FileTooLarge = 'file-too-large', FileTooSmall = 'file-too-small', TooManyFiles = 'too-many-files',}
member FileInvalidType
FileInvalidType = 'file-invalid-type'
member FileTooLarge
FileTooLarge = 'file-too-large'
member FileTooSmall
FileTooSmall = 'file-too-small'
member TooManyFiles
TooManyFiles = 'too-many-files'
Type Aliases
type DropEvent
type DropEvent = | React.DragEvent<HTMLElement> | React.ChangeEvent<HTMLInputElement> | DragEvent | Event;
type DropzoneOptions
type DropzoneOptions = Pick<React.HTMLProps<HTMLElement>, PropTypes> & { accept?: Accept; minSize?: number; maxSize?: number; maxFiles?: number; preventDropOnDocument?: boolean; noClick?: boolean; noKeyboard?: boolean; noDrag?: boolean; noDragEventsBubbling?: boolean; disabled?: boolean; onDrop?: <T extends File>( acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent ) => void; onDropAccepted?: <T extends File>(files: T[], event: DropEvent) => void; onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void; getFilesFromEvent?: ( event: DropEvent ) => Promise<Array<File | DataTransferItem>>; onFileDialogCancel?: () => void; onFileDialogOpen?: () => void; onError?: (err: Error) => void; validator?: <T extends File>(file: T) => FileError | readonly FileError[] | null; useFsAccessApi?: boolean; autoFocus?: boolean;};
type DropzoneState
type DropzoneState = DropzoneRef & { isFocused: boolean; isDragActive: boolean; isDragAccept: boolean; isDragReject: boolean; isFileDialogActive: boolean; acceptedFiles: readonly FileWithPath[]; fileRejections: readonly FileRejection[]; rootRef: React.RefObject<HTMLElement>; inputRef: React.RefObject<HTMLInputElement>; getRootProps: <T extends DropzoneRootProps>(props?: T) => T; getInputProps: <T extends DropzoneInputProps>(props?: T) => T;};
Package Files (1)
Dependencies (3)
Dev Dependencies (66)
- @babel/cli
- @babel/core
- @babel/eslint-parser
- @babel/plugin-external-helpers
- @babel/plugin-proposal-do-expressions
- @babel/plugin-proposal-export-default-from
- @babel/plugin-proposal-logical-assignment-operators
- @babel/plugin-proposal-nullish-coalescing-operator
- @babel/plugin-proposal-optional-chaining
- @babel/plugin-proposal-pipeline-operator
- @babel/plugin-transform-runtime
- @babel/preset-env
- @babel/preset-react
- @babel/register
- @commitlint/cli
- @commitlint/config-angular
- @commitlint/prompt
- @commitlint/prompt-cli
- @rollup/plugin-babel
- @rollup/plugin-commonjs
- @rollup/plugin-node-resolve
- @size-limit/preset-small-lib
- @size-limit/webpack
- @size-limit/webpack-why
- @testing-library/dom
- @testing-library/jest-dom
- @testing-library/react
- @testing-library/react-hooks
- @types/react
- @types/react-dom
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- babel-jest
- babel-plugin-add-module-exports
- babel-plugin-dynamic-import-node
- commitizen
- cross-env
- eslint
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jsx-a11y
- eslint-plugin-node
- eslint-plugin-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
- husky
- imagemin-cli
- imagemin-pngquant
- jest
- lint-staged
- markdownlint-cli
- pinst
- prettier
- react
- react-dom
- react-styleguidist
- react-test-renderer
- rimraf
- rollup
- rollup-plugin-terser
- size-limit
- style-loader
- styled-components
- typescript
- webpack
- webpack-blocks
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-dropzone
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-dropzone)
- HTML<a href="https://www.jsdocs.io/package/react-dropzone"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3420 ms. - Missing or incorrect documentation? Open an issue for this package.