Skip to content

Commit

Permalink
added separated arguments for css classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Dec 22, 2018
1 parent 1e3797d commit 7265188
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![npm](https://img.shields.io/npm/dt/react-csv-reader.svg)](https://www.npmjs.com/package/react-csv-reader)

React component that handles csv file input.
It handles file input and returns its content as a matrix.
It handles file input and returns its content as a matrix.

You can try it out in a [demo on Codesandbox](https://codesandbox.io/s/5058ln02lx).

Expand Down Expand Up @@ -38,7 +38,7 @@ class App extends Component {
render() {
return (
<CSVReader
cssClass="csv-input"
cssClass="csv-reader-input"
label="Select CSV with secret Death Star statistics"
onFileLoaded={this.handleForce}
onError={this.handleDarkSideForce}
Expand All @@ -54,15 +54,16 @@ ReactDOM.render(<App />, document.getElementById('root'))

### Parameters

| Name | Type | Default | Description |
| ------------- | --------------- | ----------- | --------------------------------------------------------------------- |
| cssClass | string | `csv-input` | A CSS class to be applied to the `<input>` element. |
| label | string, element | | If present, it will be rendered in a `<label>` to describe input aim. |
| onFileLoaded | function | | (**_required_**) The function to be called passing loaded results. |
| onError | function | | Error handling function. |
| parserOptions | object | `{}` | [PapaParse configuration](https://www.papaparse.com/docs#config) object override |
| inputId | string | | An id to be applied to the `<input>` element. |
| inputStyle | object | `{}` | Some style to be applied to the `<input>` element. |
| Name | Type | Default | Description |
| ------------- | --------------- | ------------------ | -------------------------------------------------------------------------------- |
| cssClass | string | `csv-reader-input` | A CSS class to be applied to the wrapper element. |
| cssInputClass | string | `csv-input` | A CSS class to be applied to the `<input>` element. |
| label | string, element | | If present, it will be rendered in a `<label>` to describe input aim. |
| onFileLoaded | function | | (**_required_**) The function to be called passing loaded results. |
| onError | function | | Error handling function. |
| parserOptions | object | `{}` | [PapaParse configuration](https://www.papaparse.com/docs#config) object override |
| inputId | string | | An id to be applied to the `<input>` element. |
| inputStyle | object | `{}` | Some style to be applied to the `<input>` element. |

### Results

Expand Down
Loading

0 comments on commit 7265188

Please sign in to comment.