Gathering detailed insights and metrics for react-csv-reader
Gathering detailed insights and metrics for react-csv-reader
Gathering detailed insights and metrics for react-csv-reader
Gathering detailed insights and metrics for react-csv-reader
react-papaparse
The fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
@uiw/react-csv-reader
React component that handles csv file input and its parsing.
@byu-law/react-csv-reader
React component that handles csv file input.
@synapsenetwork/csv-reader-fork
React component that handles csv file input. Fork of nzambello/react-csv-reader
React component that handles csv file input and its parsing
npm install react-csv-reader
Typescript
Module System
Node Version
NPM Version
TypeScript (82.6%)
JavaScript (17.4%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
200 Stars
203 Commits
46 Forks
2 Watchers
6 Branches
17 Contributors
Updated on May 14, 2025
Latest Version
4.0.0
Package Id
react-csv-reader@4.0.0
Unpacked Size
92.53 kB
Size
30.83 kB
File Count
10
NPM Version
9.4.0
Node Version
19.6.0
Published on
Mar 23, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
38
React component that handles csv file input. It handles file input and returns its content as a matrix.
Docs: nzambello.github.io/react-csv-reader
You can try it out in the playground in the docs or in the demo on Codesandbox.
Install the package with either yarn or npm.
With yarn:
1yarn add react-csv-reader
With npm:
1npm install --save react-csv-reader
Basic usage:
1import React, { Component } from 'react' 2import ReactDOM from 'react-dom' 3import CSVReader from 'react-csv-reader' 4 5class App extends Component { 6 ... 7 8 render() { 9 return ( 10 <CSVReader onFileLoaded={(data, fileInfo, originalFile) => console.dir(data, fileInfo, originalFile)} /> 11 ) 12 } 13} 14 15ReactDOM.render(<App />, document.getElementById('root'))
More complex example:
1import React, { Component } from 'react' 2import ReactDOM from 'react-dom' 3import CSVReader from 'react-csv-reader' 4 5class App extends Component { 6 ... 7 8 const papaparseOptions = { 9 header: true, 10 dynamicTyping: true, 11 skipEmptyLines: true, 12 transformHeader: header => 13 header 14 .toLowerCase() 15 .replace(/\W/g, '_') 16 } 17 18 render() { 19 return ( 20 <CSVReader 21 cssClass="csv-reader-input" 22 label="Select CSV with secret Death Star statistics" 23 onFileLoaded={this.handleForce} 24 onError={this.handleDarkSideForce} 25 parserOptions={papaparseOptions} 26 inputId="ObiWan" 27 inputName="ObiWan" 28 inputStyle={{color: 'red'}} 29 /> 30 ) 31 } 32} 33 34ReactDOM.render(<App />, document.getElementById('root'))
Name | Type | Default | Description |
---|---|---|---|
accept | string | .csv, text/csv | File type accepted by file input. |
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. |
cssLabelClass | string | csv-label | A CSS class to be applied to the <label> 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, see below. | |
onError | function | Error handling function. | |
parserOptions | object | {} | PapaParse configuration object override |
inputId | string | react-csv-reader-input | An id to be applied to the <input> element. |
inputName | string | react-csv-reader-input | A name attribute to be applied to the <input> element. |
inputStyle | object | {} | Some style to be applied to the <input> element. |
fileEncoding | string | UTF-8 | Encoding type of the input file. |
disabled | boolean | false | Set input disabled attribute. |
strict | boolean | false | Throws error on onError if file type is different from accept . |
When the file has been loaded, it will be parsed with PapaParse from a CSV formatted text to a matrix of strings or a list of objects (using header
option).
That parsed data is returned to the parent component with onFileLoaded
function (it will be passed as an argument).
The second argument to onFileLoaded
will be an object with infos about loaded file.
1// data: PapaParse.ParseResult.data 2// fileInfo: IFileInfo 3onFileLoaded: (data: Array<any>, fileInfo: IFileInfo, originalFile: File) => any
For type definitions, see here.
This packages uses jest
for unit tests and snapshot testing.
To run the tests:
1yarn test
Automated accessibility tests are run with jest-axe
.
Please follow our convention on commits format.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/12 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
121 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More