A contacts CSV might have a column called Work Email, while your React app expects an email field. Even after those columns are matched, a value like not-an-email still needs fixing. An editable preview lets users correct the value while they can see the rest of the row.

I’m building CSVJetty to handle that workflow in React. I made a CodePen with two sample contacts so you can try it without a CSVJetty account or importer key.

Try the live demo on CodePen

Import two sample contacts

  1. Click Download sample CSV, then click Import contacts and select the file.
  2. Check that Work Email maps to Email.
  3. In the review table, change Sam Rivera’s email from not-an-email to sam@example.com.
  4. Finish the import. Under Imported records, you’ll see both contacts and their original CSV row numbers as JSON.

Receive the rows in React

Install csvjetty and pass the public importer key from your CSVJetty dashboard. The onData callback receives the rows when the user finishes the import.

npm install csvjetty 
"use client"; import { useState } from "react"; import CSVJetty from "csvjetty"; export default function ImportContacts({ importerKey }) { const [batch, setBatch] = useState(null); async function receiveContacts({ rows, rowNumbers }) { setBatch({ rows, rowNumbers }); return { errors: [] }; } return ( <section> <CSVJetty importerKey={importerKey} onData={receiveContacts}> Import contacts </CSVJetty> {batch && ( <> <h2>Imported records</h2> <pre>{JSON.stringify(batch, null, 2)}</pre> </> )} </section> ); } 

This component displays the same callback data as the Pen. To save the contacts in your own app, send rows to your backend from onData and validate them there before writing them to your database.

Read the CSVJetty React docs