File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed
Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff 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
101101Initialize once at the start of your application:
102102
@@ -111,7 +111,11 @@ const uploader = new Uploader({
111111
112112Then 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
117121import { 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
133148import { 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
144170The callbacks receive a ` Array<UploaderResult> ` :
You can’t perform that action at this time.
0 commit comments