A react component to easily Export csv of your json data and rearrange your headers column based on your UI tables order.
npm install react-export-json-csv


A react component to easily Export csv of your json data and rearrange your headers column based on your UI tables order.
Install with npm:
``sh`
npm i react-export-json-csv
jsx
import { ExportJsonCsv } from 'react-export-json-csv';
...
const headers = [
{
key: 'id',
name: 'ID',
},
{
key: 'fname',
name: 'First Name',
},
]const data = [
{
id: '1',
fname: 'John',
},
{
id: '2',
fname: 'Doe',
},
]
...
Export
`Props
| Prop | Type | Requirement | Default | Description |
| --------- | --------- | ------------ | ------- | --------------------------------------------------- |
| headers |
array | required | null | array of objects |
| items | array | required | null | array of objects |
| fileTitle| string | optional | "exported.csv" | The complete filename |
| style| object | optional | null | use react inline style |
| className| string | optional | null` | use your existing class for button |Please help provide good data faster! Submit any issues and/or make a pull request!