You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Exclude logo/ from npm package
- Remove text version of the logo
- Remove symbols and simplify SVG
- Add PNG version of logo
- Use imagemin and lint-staged to optimize images
- Add export script
Simple HTML5 drag-drop zone for files with React.js.
5
12
6
-
Try it out here: http://okonet.ru/react-dropzone/
13
+
Demo: http://okonet.ru/react-dropzone/
14
+
</div>
15
+
16
+
---
7
17
8
-
Installation
9
-
============
18
+
## Installation
10
19
11
20
The easiest way to use react-dropzone is to install it from npm and include it in your React build process (using [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/), etc).
12
21
@@ -20,24 +29,21 @@ Create a standalone module using *WebPack*:
20
29
> webpack
21
30
```
22
31
23
-
React 0.13 users
24
-
=====
32
+
### React 0.13 users
25
33
26
34
Vesion 3.x is not compatible with React 0.13. If you can't upgrade to React 0.14 right now, you should use v 2.x of this package.
Simply `require('react-dropzone')` and specify an `onDrop` method which accepts two arguments. The first argument represents the accepted files and the second argument the rejected files.
36
43
37
44
The `onDrop` method gets always called if a file was uploaded, regardless if it was accepted or rejected. The library provides two additional methods named `onDropAccepted` and `onDropRejected`. The `onDropAccepted` method will be called if all dropped files were accepted and the `onDropRejected` method will be called if any of the dropped files was rejected.
38
45
39
-
Example
40
-
=====
46
+
## Example
41
47
42
48
```jsx
43
49
@@ -65,8 +71,7 @@ var DropzoneDemo = React.createClass({
65
71
React.render(<DropzoneDemo />, document.body);
66
72
```
67
73
68
-
Reacting to user input
69
-
=====
74
+
### Reacting to user input
70
75
71
76
By default, the component picks up some default styling to get you started. You can customize `<Dropzone>` by specifying a `style`, `activeStyle` or `rejectStyle` which is applied when a file is dragged over the zone. You can also specify `className`, `activeClassName` or `rejectClassName` if you would rather style using CSS.
72
77
@@ -88,8 +93,7 @@ You have a third option : providing a function that returns the component's chil
88
93
</Dropzone>
89
94
```
90
95
91
-
Features
92
-
========
96
+
## Features
93
97
94
98
-`preventDropOnDocument``[Boolean | **true**]` — When a file is dropped outside of any `<Dropzone>` instance, whether to prevent the browser from navigating to it.
95
99
-`disableClick``[Boolean | **false**]` — Clicking the `<Dropzone>` brings up the browser file picker.
@@ -103,7 +107,7 @@ Features
103
107
To show a preview of the dropped file while it uploads, use the `file.preview` property. Use `<img src={file.preview} />` to display a preview of the image dropped.
104
108
You can disable the creation of the preview (for example if you drop big files) by setting the `disablePreview` prop to `true`.
105
109
106
-
####Manual Upload
110
+
### Manual Upload
107
111
* To trigger the dropzone manually (open the file prompt), call the component's `open` function.
108
112
* The completion handler for the `open` function is also the `onDrop` function.
109
113
@@ -150,8 +154,7 @@ var DropzoneDemo = React.createClass({
150
154
React.render(<DropzoneDemo />, document.body);
151
155
```
152
156
153
-
Uploads
154
-
=======
157
+
## Uploads
155
158
156
159
Using `react-dropzone` is similar to using a file form field, but instead of getting the `files` property from the field, you listen to the `onDrop` callback to handle the files. Simple explanation here: http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax
157
160
@@ -167,8 +170,8 @@ Specifying the `onDrop` method, provides you with an array of [Files](https://de
167
170
}
168
171
```
169
172
170
-
Support
171
-
=======
173
+
## Support
174
+
172
175
### Backers
173
176
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/react-dropzone#backer)]
174
177
@@ -238,7 +241,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
0 commit comments