1- export { Root } from ' ./root.js'
2- import { Head } from ' mdx-go'
3-
1+ export { Root } from " ./root.js" ;
2+ import { Head } from " mdx-go" ;
43
54# ⌗ react-json-to-csv
5+
66A react button component to easily generate csv downloads of your json data. ✨
77
88[ ![ npm package version] ( https://badge.fury.io/js/react-json-to-csv.svg )] ( https://www.npmjs.com/package/react-json-to-csv )   ;
99[ ![ npm downloads] ( https://img.shields.io/npm/dm/react-json-to-csv )] ( https://www.npmjs.com/package/react-json-to-csv )   ;
1010[ ![ code style: prettier] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg )] ( https://prettier.io )
1111
12-
1312<Head >
1413 <title >react-json-to-csv</title >
1514</Head >
1615
1716## Features
17+
1818- Create a csv download from json data
1919- Lightweight
2020- Easy to use
@@ -23,24 +23,29 @@ A react button component to easily generate csv downloads of your json data. ✨
2323## Install
2424
2525Install with npm:
26+
2627``` sh
2728npm i react-json-to-csv
2829```
30+
2931Or load from a CDN:
32+
3033``` html
3134<script src =" https://cdn.jsdelivr.net/npm/react-json-to-csv" ></script >
3235```
3336
34-
3537## Example Usage
38+
3639Easy, breezy, just add data.
40+
3741``` .jsx
38- < CsvDownload data= {mockData} / >
42+ < CsvDownloadButton data= {mockData} / >
3943```
4044
4145Add a filename or other props.
46+
4247``` .jsx
43- < CsvDownload
48+ < CsvDownloadButton
4449 data= {mockData}
4550 filename= " good_data.csv"
4651 style= {{ // pass other props, like styles
@@ -59,16 +64,18 @@ Add a filename or other props.
5964 }}
6065 >
6166 Good Data ✨
62- < / CsvDownload >
67+ < / CsvDownloadButton >
6368```
6469
6570## Props
6671
67- | Prop | Type | Requirement | Default | Description |
68- | --------- | --------- | ------------ | ------- | --------------------------------------------------- |
69- | data | ` object ` | ` required ` | ` null ` | object or array of objects |
70- | filename| ` string ` | ` optional ` | "export.csv" | The complete filename |
72+ | # | Property | Type | Requirement | Default | Description |
73+ | --- | --------- | ---------- | ----------- | ------------------------- | ----------------------------------------------------------------------------- |
74+ | 1 | data | ` [] ` | ` required ` | | array of objects |
75+ | 2 | filename | ` string ` | ` optional ` | "export.csv" | The filename. The ` .csv ` extention will be edded if not included in file name |
76+ | 3 | delimiter | ` string ` | ` optional ` | ";" | fields separator |
77+ | 4 | headers | ` string[] ` | ` optional ` | provided data object keys | List of columns that will be used in the final CSV file. |
7178
7279## Contributing
7380
74- Please help provide good data faster! Submit any issues and/or make a pull request!
81+ Please help provide good data faster! Submit any issues and/or make a pull request!
0 commit comments