Gathering detailed insights and metrics for react-csv-downloader
Gathering detailed insights and metrics for react-csv-downloader
Gathering detailed insights and metrics for react-csv-downloader
Gathering detailed insights and metrics for react-csv-downloader
react-papaparse
The fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
react-async-csv-downloader
A small hook to enable asynchronous downloading of csv files
react-csv-formatter
all csv downloader
use-csv-downloader
Javascript function to convert json to csv and download to client. Can be used like a React hook.
npm install react-csv-downloader
Typescript
Module System
Node Version
NPM Version
97.3
Supply Chain
100
Quality
78.7
Maintenance
100
Vulnerability
100
License
TypeScript (81.03%)
JavaScript (14.4%)
CSS (2.86%)
HTML (1.72%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
119 Stars
501 Commits
34 Forks
2 Watchers
3 Branches
13 Contributors
Updated on Jul 07, 2025
Latest Version
3.3.0
Package Id
react-csv-downloader@3.3.0
Unpacked Size
121.42 kB
Size
17.04 kB
File Count
29
NPM Version
10.8.2
Node Version
20.17.0
Published on
Dec 30, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
A simple react component to allow download CSV file from js object
1npm install --save react-csv-downloader
Use with children component
1import CsvDownloader from 'react-csv-downloader'; 2<CsvDownloader> 3 <button>Download</button> 4</CsvDownloader>;
Use without children component
1<CsvDownloader text="Download" />
pass the downloaded datas as a component prop
1const datas = [ 2 { 3 cell1: 'row 1 - cell 1', 4 cell2: 'row 1 - cell 2', 5 }, 6 { 7 cell1: 'row 2 - cell 1', 8 cell2: 'row 2 - cell 2', 9 }, 10]; 11 12<CsvDownloader datas={datas} />;
pass a function to compute datas to be downloaded
1const asyncFnComputeDate = () => { 2 // do whatever you need async 3 return Promise.resolve([ 4 { 5 cell1: 'row 1 - cell 1', 6 cell2: 'row 1 - cell 2', 7 }, 8 { 9 cell1: 'row 2 - cell 1', 10 cell2: 'row 2 - cell 2', 11 }, 12 ]); 13}; 14 15<CsvDownloader datas={asyncFnComputeDate} />;
pass the columns definition as a component prop to change the cell display name. If column isn't passed the cell display name is automatically defined with datas keys
1const columns = [ 2 { 3 id: 'cell1', 4 displayName: 'Cell 1', 5 }, 6 { 7 id: 'cell2', 8 displayName: 'Cell 2', 9 }, 10]; 11 12<CsvDownloader columns={columns} />;
You can also use the columns definition to set the columns display order
Name | Type | Default | Required | Description |
---|---|---|---|---|
columns | array of object | null | false | Columns definition |
datas | array of object/Func/Promise | null | true | Downloaded datas or a Promise or a function that can resolve data on demand (async) |
filename | string | null | true | You can pass the filename without extension. The extension is automatically added |
extension | string | '.csv' | false | You can pass the file extension, note that it will affect filename |
separator | string | ',' | false | Columns separator |
noHeader | boolean | false | false | If true the header isn't added to the csv file |
prefix | string or boolean | false | false | Filename prefix. If true prefix becomes a timestamp |
suffix | string or boolean | false | false | Filename suffix/postfix. If true suffix becomes a timestamp |
text | string | null | false | Download button text. Used if no children component. |
wrapColumnChar | string | '' | false | Character to wrap every data and header value with. |
bom | boolean | true | false | Activate or deactivate bom mode |
newLineAtEnd | boolean | false | false | Insert new line at end of file. |
disabled | boolean | false | false | If true the download process is blocked. |
meta | boolean | false | false | If true the downloaded file will contain meta instruction sep to help microsoft excel and open office to recognize the sepator character. |
handleError | function | undefined | false | Function to be invoked on error data |
handleEmpty | function | undefined | false | Function to be invoked on empty result data |
title | string | undefined | false | You can pass a string to be added as a title at the top of the sheet |
All other props are passed to button or wrapping component.
pass the downloaded datas as a component prop
1render() { 2 const columns = [{ 3 id: 'first', 4 displayName: 'First column' 5 }, { 6 id: 'second', 7 displayName: 'Second column' 8 }]; 9 10 const datas = [{ 11 first: 'foo', 12 second: 'bar' 13 }, { 14 first: 'foobar', 15 second: 'foobar' 16 }]; 17 18 return ( 19 <div> 20 <CsvDownloader 21 filename="myfile" 22 extension=".csv" 23 separator=";" 24 wrapColumnChar="'" 25 columns={columns} 26 datas={datas} 27 text="DOWNLOAD" /> 28 </div> 29 ); 30} 31 32// content of myfile.csv 33// 'First column';'Second column' 34// 'foo';'bar' 35// 'foobar';'foobar'
If you just need to get CSV contents, use import { toCsv } from 'react-csv-downloader';
to import toCsv function and use it directly.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
SAST tool is run on all commits
Details
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More