44 </a >
55</h1 >
66
7- <p align =" center " ><b >React File & Image Uploader </b ><br /> (React Wrapper for <a href =" https://upload.io/uploader " >Uploader</a >)</p >
7+ <p align =" center " ><b >React File Upload Component </b ><br /> (React Wrapper for <a href =" https://upload.io/uploader " >Uploader</a >)</p >
88<br />
99<p align =" center " >
10- <a href =" https://github.com/upload-js /uploader/ " >
10+ <a href =" https://github.com/upload-io /uploader/ " >
1111 <img src="https://img.shields.io/badge/gzipped-29%20kb-4ba0f6" />
1212 </a >
1313
1414 <a href =" https://www.npmjs.com/package/uploader " >
1515 <img src="https://img.shields.io/badge/uploader-npm-4ba0f6" />
1616 </a >
1717
18- <a href =" https://github.com/upload-js /uploader/actions/workflows/ci.yml " >
18+ <a href =" https://github.com/upload-io /uploader/actions/workflows/ci.yml " >
1919 <img src="https://img.shields.io/badge/build-passing-4ba0f6" />
2020 </a >
2121
2828 <img src="https://img.shields.io/badge/TypeScript-included-4ba0f6" />
2929 </a >
3030
31- <a href =" https://github.com/upload-js /uploader/actions/workflows/ci.yml " >
31+ <a href =" https://github.com/upload-io /uploader/actions/workflows/ci.yml " >
3232 <img src="https://img.shields.io/npms-io/maintenance-score/upload-js?color=4ba0f6" />
3333 </a >
3434
3838
3939</p >
4040
41+ # Quick Start
42+
43+
44+ ``` shell
45+ npm install react-uploader
46+ ```
47+
48+ ``` javascript
49+ const { UploadButton } = require (" react-uploader" );
50+ const { Uploader } = require (" uploader" );
51+
52+ const uploader = new Uploader ({
53+ apiKey: " free" // Get production API keys from Upload.io
54+ });
55+
56+ < UploadButton uploader= {uploader}
57+ options= {{multi: true }}
58+ onComplete= {files => console .log (files)}>
59+ {({onClick}) =>
60+ < button onClick= {onClick}>
61+ Upload a file...
62+ < / button>
63+ }
64+ < / UploadButton>
65+ ```
66+
67+ # Documentation
68+
4169## Installation
4270
4371Install via NPM:
@@ -58,9 +86,7 @@ Or via a `<script>` tag:
5886<script src =" https://js.upload.io/react-uploader/v1" ></script >
5987```
6088
61- ## Usage
62-
63- ### Initialize
89+ ## Initialization
6490
6591Initialize once at the start of your application:
6692
@@ -74,9 +100,11 @@ const uploader = new Uploader({
74100});
75101```
76102
77- ### Render a File Upload Component
103+ ## Using the File Upload Components
104+
105+ ` react-uploader ` provides two UI components:
78106
79- #### Option 1: Render a File Upload Button
107+ ### Option 1: Creating a File Upload Button
80108
81109``` javascript
82110// Ignore if installed via a script tag.
@@ -93,7 +121,7 @@ const { UploadButton } = require("react-uploader");
93121< / UploadButton>
94122```
95123
96- #### Option 2: Render a Dropzone
124+ ### Option 2: Creating a Dropzone
97125
98126``` javascript
99127// Ignore if installed via a script tag.
@@ -106,7 +134,7 @@ const { UploadDropzone } = require("react-uploader");
106134 height= " 375px" / >
107135```
108136
109- ### The Result
137+ ## The Result
110138
111139The ` onComplete ` callback returns a ` Array<UploaderResult> ` :
112140
@@ -140,13 +168,13 @@ The `onComplete` callback returns a `Array<UploaderResult>`:
140168
141169` react-uploader ` is a wrapper for ` uploader ` .
142170
143- Please see: ** [ Uploader Docs] ( https://github.com/upload-js /uploader#%EF%B8%8F-configuration ) ** .
171+ Please see: ** [ Uploader Docs] ( https://github.com/upload-io /uploader#%EF%B8%8F-configuration ) ** .
144172
145173## Contribute
146174
147175If you would like to contribute to Uploader:
148176
149- 1 . Add a [ GitHub Star] ( https://github.com/upload-js /uploader/stargazers ) to the project (if you're feeling generous!).
177+ 1 . Add a [ GitHub Star] ( https://github.com/upload-io /uploader/stargazers ) to the project (if you're feeling generous!).
1501782 . Determine whether you're raising a bug, feature request or question.
1511793 . Raise your issue or PR.
152180
0 commit comments