
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@simuratli/react-json-csv-converter
Advanced tools
A lightweight and customizable React component that enables users to download JSON data as a CSV file with a single button click.
className
, disabled
, etc.) for customization.npm install @simuratli/react-json-csv-converter
or
yarn add @simuratli/react-json-csv-converter
import { JsonToCsvDownload } from '@simuratli/react-json-csv-converter';
const data = [
{ id: 1, name: 'Alice', age: 30 },
{ id: 2, name: 'Bob', age: 25 }
];
<JsonToCsvDownload data={data} filename="users.csv">
Export Users
</JsonToCsvDownload>;
import { JsonToCsvDownload } from '@simuratli/react-json-csv-converter';
const data = [
{ id: 1, name: 'Alice', age: 30 },
{ id: 2, name: 'Bob', age: 25 }
];
const headers = [
{ label: 'User ID', key: 'id' },
{ label: 'Full Name', key: 'name' },
{ label: 'User Age', key: 'age' }
];
<JsonToCsvDownload
data={data}
headers={headers}
filename="custom_users.csv"
className="my-custom-button"
>
Download CSV
</JsonToCsvDownload>;
Prop | Type | Description |
---|---|---|
data | object[] | Required. The JSON array to convert and download as CSV. |
headers | { label: string, key: string }[] | null | Optional. Custom headers for CSV: display label and extract from key . |
filename | string | Optional. Name of the downloaded CSV file. Default is data.csv . |
className | string | Optional. Custom CSS classes for the button. |
children | ReactNode | Optional. Button label/content. Default is "Download CSV" . |
onDownload | () => void | Optional. Callback after successful CSV download. |
...props | ButtonHTMLAttributes<HTMLButtonElement> | Optional. All standard <button> props supported. |
npm run dev
MIT ยฉ Your Name or GitHub Handle
FAQs
React json to csv converter
The npm package @simuratli/react-json-csv-converter receives a total of 27 weekly downloads. As such, @simuratli/react-json-csv-converter popularity was classified as not popular.
We found that @simuratli/react-json-csv-converter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.