Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/praveenkumar-kalidass/react-json-csv

A React library to render a component that helps in json to csv conversion.
https://github.com/praveenkumar-kalidass/react-json-csv

convert csv json react

Last synced: about 1 month ago
JSON representation

A React library to render a component that helps in json to csv conversion.

Awesome Lists containing this project

README

        

# React Json Csv
A React library to render a component that helps in json to csv conversion.



npm version


dependencies Status badge


devDependency Status badge


Downloads


Paypal

## Install

Install the component using [NPM](https://www.npmjs.com/):

```sh
$ npm install --save react-json-csv
```

## Usage

### Initialise module

```js
import {
JsonToCsv,
useJsonToCsv
} from 'react-json-csv';
```

### Render
- [Json To Csv](#json-to-csv)
- [use Json To Csv](#use-json-to-csv)

#### Json To Csv
Converts json to csv file (.csv format) and downloads it

```js
const filename = 'Csv-file',
fields = {
"index": "Index",
"guid": "GUID"
},
style = {
padding: "5px"
},
data = [
{ index: 0, guid: 'asdf231234'},
{ index: 1, guid: 'wetr2343af'}
],
text = "Convert Json to Csv";
```

```html

```

#### use Json To Csv

```js
const { saveAsCsv } = useJsonToCsv();
```

```html

useJsonToCsv

```html

## License

[MIT License](http://opensource.org/licenses/MIT)