Skip to content

Commit 50ecba6

Browse files
committed
Chore(Readme): Update read me
1 parent 25142d8 commit 50ecba6

File tree

3 files changed

+112
-132
lines changed

3 files changed

+112
-132
lines changed

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44

55
![demo](https://s5.gifyu.com/images/upload-demo.gif)
66

7-
A library for adding a simple multiple image upload and cropping feature to your react app.
8-
97
Requires react >= 16.8.0
108

119
This package makes use of [react-image-cropper](https://github.com/DominicTobias/react-image-crop)
1210

1311
## Installation
1412

1513
Run the following command:
16-
`npm install react-multiple-image-upload`
14+
`npm install react-multiple-image-input`
1715

1816
## Usage
1917

@@ -32,7 +30,7 @@ function App() {
3230

3331
return (
3432
<MultiImageInput
35-
images={setImages}
33+
images={images}
3634
setImages={setImages}
3735
cropConfig={{ crop, ruleOfThirds: true }}
3836
/>
@@ -55,9 +53,9 @@ export default App;
5553

5654
# Props Explained
5755

58-
### images(required)
56+
### images(required)(_object_)
5957

60-
This is an object that houses the Base64 URLs to all the selected images. Each image has a key that starts from index `0` and is incremental as more images are added. It should be a state variable so that `react-multiple-image-input` can update. Example:
58+
This is an object that houses the Base64 URLs to all the selected images. Each image has a key that starts from index `0` and is incremental as more images are added. It should be a state variable so that `react-multiple-image-input` can update it. Example:
6159

6260
```javascript
6361
{
@@ -67,17 +65,17 @@ This is an object that houses the Base64 URLs to all the selected images. Each i
6765
}
6866
```
6967

70-
### setImages(required)
68+
### setImages(required)(_function_)
7169

7270
A function for updating the images state. This can be easily acheived with react's useState hook.
7371

7472
```javascript
7573
const [images, setImages] = useState({});
7674
```
7775

78-
### max
76+
### max(optional)(_number_)
7977

80-
This specifies the maximum number images you want this component to hold. It is set to `3` by default.
78+
This specifies the maximum number of images you want this component to hold. It is set to `3` by default.
8179

8280
```jsx
8381
<MultiImageInput
@@ -88,19 +86,19 @@ This specifies the maximum number images you want this component to hold. It is
8886
/>
8987
```
9088

91-
### allowCrop
89+
### allowCrop(optional)(_boolean_)
9290

9391
A boolean attribute for enabling/disabling cropping. It is `true` by default, set it to `false` if you don't want cropping.
9492

95-
### cropConfig
93+
### cropConfig(optional)(_object_)
9694

9795
This sets the dimensions for cropping. You can pass in dimension props accepted by [react-image-cropper](https://github.com/DominicTobias/react-image-crop) into this object. A list of these props include
9896

9997
- crop
10098

10199
All crop params are initially optional.
102100

103-
\* _While you can initially omit the crop object, any subsequent change will need to be saved to state in the `onChange` and passed into the component._
101+
\* _While you can initially omit the crop object, any subsequent change will need to be saved and passed into the component._
104102

105103
```js
106104
crop: {

dist/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)