🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-json-csv

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-json-csv

A React component to handle json to csv conversion

2.1.0
latest
Source
npm
Version published
Weekly downloads
1.8K
-23.68%
Maintainers
1
Weekly downloads
 
Created
Source

React Json Csv

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

License Version Downloads Branch Status Coverage Status Paypal

Install

Install the component using NPM:

$ npm install --save react-json-csv

Or YARN;

$ yarn add react-json-csv

Usage

Initialise module

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

Render

JsonToCsv

Converts json to csv file (.csv format) and downloads it

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";
<JsonToCsv
  data={data}
  filename={filename}
  fields={fields}
  style={style}
  text={text}
/>

useJsonToCsv

const { saveAsCsv } = useJsonToCsv();
<button onClick={saveAsCsv({ data, fields, filename })}>
  useJsonToCsv
</button>

Keywords

react

FAQs

Package last updated on 23 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts