Package Exports
- react-csv-importer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-csv-importer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React CSV Importer
This library provides an uploader + CSV parser + raw file preview + UI for custom user column mapping, all in one.
Use this in your web app's bulk data import screen to allow users to drop a file for upload, preview the raw uploaded data before parsing and pick which columns to import.
The UI theme is standalone (has no external dependencies such as Material UI) and tailored to universally fit within most application design frameworks. Interface elements are tested for screen reader accessibility and keyboard-only usage.
Example usage:
import { Importer, ImporterField } from 'react-csv-importer';
<Importer
processChunk={async (rows) => {
for (row of rows) {
// console.log('saving row', row)
await myAppMethod(row);
}
}}
onFinish={() => {
// console.log('import finished');
goToMyAppNextPage();
}}
>
<ImporterField name="name" label="Name" />
<ImporterField name="email" label="Email" />
<ImporterField name="dob" label="Date of Birth" optional />
<ImporterField name="postalCode" label="Postal Code" optional />
</Importer>;