Skip to content

Commit 84942d3

Browse files
committed
Update README
1 parent 32a75d1 commit 84942d3

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Or via a `<script>` tag:
9696
<script src="https://js.upload.io/react-uploader/v1"></script>
9797
```
9898

99-
## Usage
99+
# Usage
100100

101101
Initialize once at the start of your application:
102102

@@ -111,7 +111,11 @@ const uploader = new Uploader({
111111

112112
Then choose a UI component:
113113

114-
### (1) File Upload Button
114+
## `UploadButton`
115+
116+
The `UploadButton` component uses a [render prop](https://reactjs.org/docs/render-props.html) to provide an `onClick` callback to your button element.
117+
118+
When the `onClick` is called, a file upload modal will appear:
115119

116120
```javascript
117121
import { UploadButton } from "react-uploader";
@@ -127,7 +131,18 @@ import { UploadButton } from "react-uploader";
127131
</UploadButton>
128132
```
129133

130-
### (2) Dropzone
134+
Required props:
135+
- `uploader`
136+
- `children` (must be a component constructor, per the example)
137+
138+
Optional props:
139+
- `options`
140+
- `onComplete`
141+
142+
143+
## `UploadDropzone`
144+
145+
Renders an inline drag-and-drop file upload dropzone:
131146

132147
```javascript
133148
import { UploadDropzone } from "react-uploader";
@@ -139,6 +154,17 @@ import { UploadDropzone } from "react-uploader";
139154
height="375px" />
140155
```
141156

157+
158+
Required props:
159+
- `uploader`
160+
161+
Optional props:
162+
- `options`
163+
- `onUpdate`
164+
- `width`
165+
- `height`
166+
167+
142168
## The Result
143169

144170
The callbacks receive a `Array<UploaderResult>`:

0 commit comments

Comments
 (0)