react-export-csv

0.0.4 • Public • Published

React Export CSV

NPM JavaScript Style Guide

React Export CSV component for React.

Installation

npm install --save react-export-csv

Documentation

Props Type Default Details
header array null header for CSV file
data array null data row for CSV file
separator string ; CSV separator (";" / "," / ...)
callback function null callback data
isDownload boolean false if auto download file
filename string "no_name.csv" file name downloaded file

Getting started

Import Component and style

import { ExportCSV } from 'react-export-csv'

Render Component

<ExportCSV
  header={[
    {
      name: "Col 1",
      key: "col_1"
    },
    {
      name: "Col 2",
      key: "col_2"
    }
  ]}
  data={[
    {
      col_1: "Data 1 col 1",
      col_2: "Data 1 col 2"
    },
    {
      col_1: "Data 2 col 1",
      col_2: "Data 2 col 2"
    }
  ]}
  separator={';'}
  callback={(res) => console.log(res)}
  isDownload={true}
  filename={"test.csv"}
/>

License

MIT © noah-lnt

Readme

Keywords

none

Package Sidebar

Install

npm i react-export-csv

Weekly Downloads

26

Version

0.0.4

License

MIT

Unpacked Size

13.7 kB

Total Files

6

Last publish

Collaborators

  • noah.lnt