
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-data-table-component-extensions
Advanced tools
Export table data as a CSV or Excel file, filter and print the data.
Export table data as a CSV or Excel file, filter and print the data.
Install the data-table component first,
$ npm install react-data-table-component styled-components
then install the data-table-extensions extension.
$ npm install react-data-table-component-extensions
Live Demo CodeSandbox
Example of filtering table data and export, print buttons.
// App.js
import React from 'react';
import DataTable from 'react-data-table-component';
import DataTableExtensions from 'react-data-table-component-extensions';
import 'react-data-table-component-extensions/dist/index.css';
import { columns, data } from './Data.js';
function App() {
const tableData = {
columns,
data,
};
return (
<DataTableExtensions
{...tableData}
>
<DataTable
noHeader
defaultSortField="id"
defaultSortAsc={false}
pagination
highlightOnHover
/>
</DataTableExtensions>
);
}
export default App;
// Data.js
export const columns = [
{
name: 'Title',
selector: 'title',
sortable: true,
},
{
name: 'Director',
selector: 'director',
sortable: true,
},
{
name: 'Genres',
selector: 'genres',
sortable: true,
cell: d => <span>{d.genres.join(', ')}</span>,
},
{
name: 'Year',
selector: 'year',
sortable: true,
},
];
export const data = [
{
title: 'Beetlejuice',
year: '1988',
genres: [
'Comedy',
'Fantasy',
],
director: 'Tim Burton',
},
{
id: 2,
title: 'The Cotton Club',
year: '1984',
runtime: '127',
genres: [
'Crime',
'Drama',
'Music',
],
director: 'Francis Ford Coppola',
}];
Descriptions and configuration settings for component properties.
Property | Type | Required | Default | Description |
---|---|---|---|---|
columns | array | yes | [ ] | Table column configuration |
data | array | no | [ ] | Table data |
filter | bool | no | true | Enable input filter |
filterPlaceholder | string | no | Filter Table | Default placeholder for the filter field |
filterHidden | bool | no | true | Filter hidden fields |
export | bool | no | true | Enable export button |
bool | no | true | Enable print button | |
exportHeaders | bool | no | false | Exports data with table headers |
filterDigit | number | no | 2 | Number of digts to use in search. |
fileName | string | no | document.title | Set exported csv and excel file name |
Property | Type | Required | Description |
---|---|---|---|
cellExport | func | no | Export configuration row => ({Title: row.Title, Example: row.Example}) |
Barış Ateş
FAQs
Export table data as a CSV or Excel file, filter and print the data.
The npm package react-data-table-component-extensions receives a total of 2,414 weekly downloads. As such, react-data-table-component-extensions popularity was classified as popular.
We found that react-data-table-component-extensions demonstrated a not healthy version release cadence and project activity because the last version was released 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.