1.1.0 • Published 4 years ago
react-json-excel v1.1.0
React Json Excel
A React library to render a component that helps in json to excel conversion.
Install
Install the component using NPM:
$ npm install --save react-json-excel
Usage
Initialise module
import {
JsonToExcel
} from 'react-json-excel';
Render
Json To Excel
Converts json to excel file (.csv format) and downloads it
const className = 'class-name-for-style',
filename = 'Excel-file',
fields = {
"index": "Index",
"guid": "GUID"
},
style = {
padding: "5px"
},
data = [
{ index: 0, guid: 'asdf231234'},
{ index: 1, guid: 'wetr2343af'}
],
text = "Convert Json to Excel";
<JsonToExcel
data={data}
className={className}
filename={filename}
fields={fields}
style={style}
text={text}
/>