1.1.1 • Published 7 years ago

react-csv-creator-jp v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-csv-creator

A react component for downloading data into a csv file.

npm

Development utilizes storybook and based on react-storybook-boilerplate.

running

$ npm i
$ npm start

packaging

$ npm run build
$ npm publish

props

NameTypeDefaultRequiredDescription
disabledboolfalsefalseDisable the downloading of the csv
headersarray objectnullfalseHeader's names
filenamestringcurrent timefalseThe filename without extension. Defaults to current date/time
noHeaderboolfalsefalseIf true, will omit the header from the file
rowsarray objectnulltrueThe main data for the csv
textstringnullfalseThe text to use if no children component

Usage

import CsvCreator from 'react-csv-creator';

const headers = [{
  id: 'first',
  display: 'First column'
}, {
  id: 'second',
  display: 'Second column'
}];

const rows = [{
  first: 'foo',
  second: 'bar'
}, {
  first: 'foobar',
  second: 'foobar'
}];

<CsvCreator
  filename='my_cool_csv'
  headers={headers}
  rows={rows}
>
  <p>Download CSV</p>
</CsvCreator>
1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago