React Csv Reader
Edit page
HomeUsagePlaygroundProps

CSVReader

Bare minimal example:

import * as React from 'react'
import CSVReader from 'react-csv-reader'
const App: React.FC = () => (
<CSVReader parserOptions={{ header: true }} onFileLoaded={(data, fileInfo) => console.dir(data, fileInfo)} />
)

Playground

Props

accept
string
.csv, text/csv
cssClass
string
csv-reader-input
cssInputClass
string
csv-input
cssLabelClass
string
csv-label
fileEncoding
string
UTF-8
inputId
string
react-csv-reader-input
inputName
string
react-csv-reader-input
inputStyle
object
{}
inputRef
LegacyRef<HTMLInputElement>
label
ReactNode
onError
(error: Error) => void
() => {}
onFileLoaded
(data: any[], fileInfo: IFileInfo, originalFile?: File) => any
required
parserOptions
ParseConfig<any>
{} as PapaParse.ParseConfig
disabled
boolean
strict
boolean