# @dropzone-ui/react 中文文档

规范地址：https://npmcn.com/package/%40dropzone-ui/react/

版本：7\.0\.4
npm 元数据更新时间：2023-04-24T16:21:33.964Z
中文译文更新时间：2026-11-12T20:35:51.997Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40dropzone-ui/react
原文对照：https://npmcn.com/package/%40dropzone-ui/react/?lang=original
项目主页：https://www.files-ui.com/
源码仓库：https://github.com/dropzone-ui/dropzone-ui-react

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.4 MB，14 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：react ^17\.0\.2 \|\| ^18\.0\.0，react-dom ^17\.0\.2 \|\| ^18\.0\.0
- 首次发布：2021-10-02T18:23:27.654Z
- 最新版本发布：2023-04-23T22:51:37.270Z
- 近 30 天下载量：13235（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：54（近 12 个月 0 个）

## 中文简介

管理文件上传的最好和最完整的React库. 多语言支持. 服务器侧支持 。 材料设计风格. 网页上的代码生成器 .

## 安装

```sh
npm install @dropzone-ui/react
```

也可以使用：`pnpm add @dropzone-ui/react`、`yarn add @dropzone-ui/react`、`bun add @dropzone-ui/react`

## README

摇滚: [西班牙语读取](https://npmcn.com/package/%40dropzone-ui/react/README_ES.md)

# 空投区 UI

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dropzone-ui/react/blob/HEAD/LICENSE) [![npm latest package](https://img.shields.io/npm/v/@dropzone-ui/react.svg?logo=npm&logoColor=fff&label=NPM+package&color=limegreen)](https://www.npmjs.com/package/@dropzone-ui/react) [![Rate on Openbase](https://badges.openbase.com/js/rating/@dropzone-ui/react.svg)](https://openbase.com/js/@dropzone-ui/react?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge) [![kandi X-Ray](https://kandi.openweaver.com/badges/xray.svg)](https://kandi.openweaver.com/typescript/dropzone-ui/dropzone-ui-react) [![Node.js CI](https://github.com/dropzone-ui/react-dropzone/actions/workflows/node.js.yml/badge.svg)](https://github.com/dropzone-ui/dropzone-ui-react) [![Build Status](https://app.travis-ci.com/dropzone-ui/dropzone-ui-react.svg?branch=master)](https://app.travis-ci.com/dropzone-ui/dropzone-ui-react) [![Known Vulnerabilities](https://snyk.io/test/github/dropzone-ui/react/badge.svg)](https://snyk.io/test/github/dropzone-ui/react) [![Package Quality](https://packagequality.com/shield/dropzone-ui.svg)](https://packagequality.com/#?package=dropzone-ui) [![install size](https://packagephobia.com/badge?p=@dropzone-ui/react)](https://packagephobia.com/result?p=@dropzone-ui/react) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/dropzone-ui/react.svg)](http://isitmaintained.com/project/dropzone-ui/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com/) [![GitHub Repo stars](https://img.shields.io/github/stars/dropzone-ui/react?label=Star%20me%20please%20:D&style=social)](https://github.com/dropzone-ui/react)

非常感谢你使用 滴区/反应!

Dropzone UI的增长速度非常快并超越了最初的范围. 这就是为什么我们发现合理 重塑它 并创建一个新的包 最好的这个, 并增加更多的特性和新的组件。 这个新软件包在这里,它的名字是File UI QQ. 在很近的将来,我们将停止对"滴滴"(droppezone-ui)的支持,所以我们强制你升级到这个新的包. 与此同时,这个软件包将成为文件-ui的包装.

:zap:现场演示和完整文档 : [文件-ui.com](https://files-ui.vercel.app/)

:心脏:它?,通过给:星:在:octocat: [吉图布](https://github.com/files-ui/files-ui-react) : D

[![](https://user-images.githubusercontent.com/43678736/225168231-35d7dc8d-f89e-43a1-8ce9-441bd59a74df.png)](https://www.files-ui.com/)

## 重要

从现在开始 [@ files-ui/ 反应](https://www.npmjs.com/package/@files-ui/react) 这是唯一的依赖。 查看更改日志文件了解新情况.

## 样本结果 :

这是文件的一小部分

[![fui-logo](https://user-images.githubusercontent.com/43678736/228052494-99d970c0-1eb7-42c6-b22c-8c2295b8dc4a.gif)](https://www.files-ui.com/)

-   更多预览 [这里](https://npmcn.com/package/%40dropzone-ui/react/#readme-more-previews)。 。 。 .

## 所需经费

`@dropzone-ui/react` 是基于 [反应钩](https://reactjs.org/docs/hooks-intro.html)它要求 `react v16.8+`。 。 。 .

## 安装

@ droppzone- ui/ 反应可用作 [npm 软件包](https://www.npmjs.com/package/@dropzone-ui/react)。 。 。 .

```sh
// with npm
npm i @dropzone-ui/react
```

```sh
// with yarn
yarn add @dropzone-ui/react
```

## 使用和实例

这是让你开始的简单例子, **这是你需要的**数字 :

```jsx
import * as React from "react";
import ReactDOM from "react-dom";
import { Dropzone, FileMosaic } from "@dropzone-ui/react";

function App() {
  const [files, setFiles] = React.useState([]);
  const updateFiles = (incommingFiles) => {
    setFiles(incommingFiles);
  };
  return (
    <Dropzone onChange={updateFiles} value={files}>
      {files.map((file) => (
        <FileMosaic {...file} preview />
      ))}
    </Dropzone>
  );
}

ReactDOM.render(<App />, document.querySelector("#app"));
```

是的,这真的是所有你需要开始 你可以看到在这些现场和互动演示:

| 基本样本: 蛋糕: | 高级标本 : |
| --- | --- |
| [![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/basic-demo-js-blssi1?file=/src/App.js) | [![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/advanced-demo-js-6euo8j?file=/src/App.js) |

## API 文档

每个组件的完整文件已移至文件-ui.com [API 页面](https://www.files-ui.com/api/dropzone)。 。 。 .

然而,如果您仍在使用6.7.0或更低的dropzone-ui版本,您可以在此找到文档并演示:

-   ⚡ [样本](https://www.npmjs.com/package/@dropzone-ui/react/v/6.7.20?activeTab=readme#Usage-and-examples)
-   📚 [文档](https://www.npmjs.com/package/@dropzone-ui/react/v/6.7.20#dropzone-ui-react-components-api)。 。 。 .

## 支持者

特别感谢这些惊人的人:

### : clap: Stargazers (星际迷航)

[![Stargazers repo roster for @dropzone-ui/dropzone-ui-react](https://reporoster.com/stars/dropzone-ui/dropzone-ui-react)](https://github.com/dropzone-ui/dropzone-ui-react/stargazers)

### : claps: 伪造者

[![Forkers repo roster for @dropzone-ui/dropzone-ui-react](https://reporoster.com/forks/dropzone-ui/dropzone-ui-react)](https://github.com/dropzone-ui/dropzone-ui-react/network/members)

## 更多预览

图像全屏幕预览QQ

![Image full screen preview](https://user-images.githubusercontent.com/43678736/228066199-fb7a5bd3-9c7e-4f72-b0ef-7f11d236d38e.png)

视频全屏幕预览QQ

![Video full screen preview](https://user-images.githubusercontent.com/43678736/228066195-62063300-21e0-48fd-80d8-31b566562fde.png)

文件卡、 文件输入按钮和 Avatar 预览QQ

![Video full screen preview](https://user-images.githubusercontent.com/43678736/228063876-5b6d00fe-f0ba-453f-a7ce-c44ba7444417.png)

黑暗模式 \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \* \*

![darkmode 1 preview](https://user-images.githubusercontent.com/43678736/228063883-569ca6f1-6959-45bc-9882-2c447162a00f.png)

![darkmode 2 preview](https://user-images.githubusercontent.com/43678736/228066720-e0bb96ac-3c00-4aa6-80b9-e0b4d0c5f947.png)

## 许可证

本项目的许可条件如下: [麻省理工学院许可证](https://npmcn.com/LICENSE)。 。 。 .

[![Animated footer bars](http://randojs.com/images/barsSmallTransparentBackground.gif)](https://github.com/dropzone-ui/react-dropzone#)

  

[![Back to top](http://randojs.com/images/backToTopButtonTransparentBackground.png)](https://github.com/dropzone-ui/react-dropzone#readme)

## 常见问题

### @dropzone-ui/react 是什么？

管理文件上传的最好和最完整的React库\. 多语言支持\. 服务器侧支持 。 材料设计风格\. 网页上的代码生成器 \.

### 如何安装 @dropzone-ui/react？

在项目目录运行 npm install @dropzone-ui/react，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^17\.0\.2 \|\| ^18\.0\.0）、react-dom（^17\.0\.2 \|\| ^18\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @dropzone-ui/react 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @dropzone-ui/react 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @dropzone-ui/react 可以商用吗？

@dropzone-ui/react 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @dropzone-ui/react 的下载量有多少？

根据 npm 官方下载统计，@dropzone-ui/react 在 2026/10/13 – 2026/11/11 这 30 天内被下载 13,235 次，日均约 441 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @dropzone-ui/react 还在维护吗？

最新版本 7\.0\.4 发布于 2023/04/24（3 年前）；至今共发布 54 个版本，其中过去 12 个月发布了 0 个；首次发布于 2021/10/03。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

