React components to build CSV files on the fly basing on Array/literal object of data

React components to build CSV files on the fly basing on Array/literal object of data

Generate CSV document according to given data.

Build Status Coverage Status

Build Status Coverage Status

Overview :

Generate a CSV file from given data.

This data can be an array of arrays, an array of literal objects, or strings.

Example :

import { CSVLink, CSVDownload } from "react-csv";

const csvData = [
  ["firstname", "lastname", "email"],
  ["Ahmed", "Tomi", "[email protected]"],
  ["Raed", "Labes", "[email protected]"],
  ["Yezzi", "Min l3b", "[email protected]"]
];
<CSVLink data={csvData}>Download me</CSVLink>;
// or
<CSVDownload data={csvData} target="_blank" />;

For more examples, see [here

Github Repository

Tags: #React #Data