0.0.4 • Published 2 years ago

react-export-csv v0.0.4

Weekly downloads
33
License
MIT
Repository
github
Last release
2 years ago

React Export CSV

NPM JavaScript Style Guide

React Export CSV component for React.

Installation

npm install --save react-export-csv

Documentation

PropsTypeDefaultDetails
headerarraynullheader for CSV file
dataarraynulldata row for CSV file
separatorstring;CSV separator (";" / "," / ...)
callbackfunctionnullcallback data
isDownloadbooleanfalseif auto download file
filenamestring"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

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago