Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Add 'customIcon' parameter to allow for setting a custom icon. Needed… #244

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .gitignore

This file was deleted.

49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,31 @@ export default App;
```
### Available Options

| parameter | type | default | description |
| :-------------: | :------: | :--------------------------------: | :------------------------------------------------------------ |
| className | String | - | Class name for the input. |
| onChange | Function | - | On change handler for the input. |
| buttonClassName | String | - | Class name for upload button. |
| buttonStyles | Object | - | Inline styles for upload button. |
| withPreview | Boolean | false | Show preview of selected images. |
| defaultImages | Array | ['imgUrl1', 'imgUrl2'] | Pre-populate with default images. |
| accept | String | "accept=image/\*" | Accept attribute for file input. |
| name | String | - | Input name. |
| withIcon | Boolean | true | If true, show upload icon on top |
| buttonText | String | 'Choose images' | The text that display in the button. |
| buttonType | String | 'submit' | The value of the button's "type" attribute. |
| withLabel | Boolean | true | Show instruction label |
| label | String | 'Max file size: 5mb, accepted: jpg, gif, png | Label text |
| labelStyles | Object | - | Inline styles for the label. |
| labelClass | string | - | Class name for the label |
| imgExtension | Array | ['.jpg', '.gif', '.png', '.gif'] | Supported image extension (will use in the image validation). |
| maxFileSize | Number | 5242880 | Max image size. |
| fileSizeError | String | " file size is too big" | Label for file size error message. |
| fileTypeError | String | " is not supported file extension" | Label for file extension error message. |
| errorClass | String | - | Class for error messages |
| errorStyle | Object | - | Inline styles for errors |
| singleImage | Boolean | false | Upload one single image |
| parameter | type | default | description |
| :-------------: | :------: | :--------------------------------: | :---------------------------------------------------------------|
| className | String | - | Class name for the input. |
| onChange | Function | - | On change handler for the input. |
| buttonClassName | String | - | Class name for upload button. |
| buttonStyles | Object | - | Inline styles for upload button. |
| withPreview | Boolean | false | Show preview of selected images. |
| defaultImages | Array | ['imgUrl1', 'imgUrl2'] | Pre-populate with default images. |
| accept | String | "accept=image/\*" | Accept attribute for file input. |
| name | String | - | Input name. |
| withIcon | Boolean | true | If true, show upload icon on top |
| customIcon | Object | - | Override default icon. e.g Dark-mode icon (included), or custom |
| buttonText | String | 'Choose images' | The text that display in the button. |
| buttonType | String | 'submit' | The value of the button's "type" attribute. |
| withLabel | Boolean | true | Show instruction label |
| label | String | 'Max file size: 5mb, accepted: jpg, gif, png | Label text |
| labelStyles | Object | - | Inline styles for the label. |
| labelClass | string | - | Class name for the label |
| imgExtension | Array | ['.jpg', '.gif', '.png', '.gif'] | Supported image extension (will use in the image validation). |
| maxFileSize | Number | 5242880 | Max image size. |
| fileSizeError | String | " file size is too big" | Label for file size error message. |
| fileTypeError | String | " is not supported file extension" | Label for file extension error message. |
| errorClass | String | - | Class for error messages |
| errorStyle | Object | - | Inline styles for errors |
| singleImage | Boolean | false | Upload one single image |

### Development

Expand Down
Loading