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

json-to-csv-downloader-react

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-to-csv-downloader-react

Simple React TypeScript component for downloading JSON data as CSV

1.0.5
latest
Source
npm
Version published
Weekly downloads
70
-74.07%
Maintainers
1
Weekly downloads
 
Created
Source

React JSON to CSV Download

A simple, lightweight React TypeScript component for downloading JSON data as CSV files with automatic or manual header detection.

Features

  • 🚀 Simple API - Just pass your JSON data and you're done
  • 📊 Auto Header Detection - Automatically extracts headers from your JSON objects
  • 🎯 Custom Headers - Specify exactly which columns to export
  • 🎨 Fully Customizable - Style it however you want
  • 📱 TypeScript Support - Full type safety and IntelliSense
  • 🔧 Flexible Content - Use any content inside the button (text, icons, etc.)
  • Zero Dependencies - Only requires React

Installation

npm install react-json-to-csv-download

Or with yarn:

yarn add react-json-to-csv-download

Quick Start

import JsonToCsvDownload from 'react-json-to-csv-download';

const MyComponent = () => {
  const data = [
    { name: "John Doe", age: 30, city: "New York" },
    { name: "Jane Smith", age: 25, city: "Los Angeles" }
  ];

  return (
    <JsonToCsvDownload data={data}>
      Download CSV
    </JsonToCsvDownload>
  );
};

API Reference

Props

PropTypeDefaultDescription
dataJsonObject[][]Required. Array of objects to convert to CSV
headersstring[] | nullnullOptional. Specific headers to include. If not provided, headers are auto-detected
filenamestring"data.csv"Name of the downloaded file
classNamestring""CSS classes for styling the button

Keywords

react

FAQs

Package last updated on 30 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