Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romellogoodman/react-csv-creator
React Component to create and download CSVs
https://github.com/romellogoodman/react-csv-creator
Last synced: about 17 hours ago
JSON representation
React Component to create and download CSVs
- Host: GitHub
- URL: https://github.com/romellogoodman/react-csv-creator
- Owner: romellogoodman
- License: mit
- Created: 2017-04-20T19:43:11.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T15:49:56.000Z (over 6 years ago)
- Last Synced: 2024-12-02T21:11:58.493Z (about 2 months ago)
- Language: JavaScript
- Size: 238 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
react-csv-creator
---
A react component for downloading data into a csv file.[![npm](https://img.shields.io/npm/v/react-csv-creator.svg)](https://www.npmjs.com/package/react-csv-creator)
Development utilizes [storybook](https://getstorybook.io/) and based on [react-storybook-boilerplate](https://github.com/romellogood/react-storybook-boilerplate).
### running
```
$ npm i
$ npm start
```### packaging
```
$ npm run build
$ npm publish
```### props
| Name | Type | Default | Required | Description |
|:---------|:-------------|:-------------|:---------|:--------------------------------------------------------------|
| disabled | bool | false | false | Disable the downloading of the csv |
| headers | array object | null | false | Header's names |
| filename | string | current time | false | The filename without extension. Defaults to current date/time |
| noHeader | bool | false | false | If true, will omit the header from the file |
| rows | array object | null | true | The main data for the csv |
| text | string | null | false | The 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'
}];
Download CSV
```