Professional-grade React DataTable component with enterprise features including hierarchical grouping, pinned columns, inline editing, virtual scrolling, and comprehensive data management capabilities.
- π Advanced Data Management: Sort, filter, group, and paginate large datasets
- π Type Safety: Full TypeScript support with customizable column definitions
- π± Responsive Design: Mobile-friendly with horizontal scrolling and adaptive layouts
- β‘ Performance: Virtual scrolling for handling thousands of rows efficiently
- π·οΈ Multi-Level Grouping: Hierarchical grouping with drag-and-drop reordering
- π Column Pinning: Pin important columns to left/right with proper shadows
- βοΈ Inline Editing: Double-click cells to edit with type-specific editors
- π Smart Filtering: Multiselect filters for select and boolean columns
- π€ Export Capabilities: CSV export with optional PDF support
- π― Row Selection: Single/multiple selection with checkbox support
- π Column Management: Show/hide, reorder, and configure columns dynamically
- π Aggregation Functions: Built-in summaries (count, sum, avg, min, max)
- π¨ Custom Renderers: Override cell, header, and footer templates
- π§ Sticky Elements: Configurable sticky headers and footers
- π Custom Actions: Extensible action bar with custom components
- π Internationalization: Ready for i18n with customizable text
npm install advanced-react-datatable
# or
yarn add advanced-react-datatable
# or
pnpm add advanced-react-datatableimport React from 'react';
import { DataTable, DataTableColumn } from 'advanced-react-datatable';
interface Employee {
id: number;
name: string;
department: string;
salary: number;
active: boolean;
}
const employees: Employee[] = [
{ id: 1, name: 'John Doe', department: 'Engineering', salary: 85000, active: true },
{ id: 2, name: 'Jane Smith', department: 'Marketing', salary: 72000, active: true }
];
const columns: DataTableColumn<Employee>[] = [
{ field: 'name', header: 'Name', sortable: true, filterable: true },
{ field: 'department', header: 'Department', groupable: true },
{ field: 'salary', header: 'Salary', type: 'number', sortable: true, aggregation: 'sum' },
{ field: 'active', header: 'Active', type: 'boolean', filterable: true }
];
function App() {
return (
<DataTable
data={employees}
columns={columns}
showFilters={true}
showColumnConfig={true}
virtualScrolling={true}
stickyHeader={true}
/>
);
}Explore the full capabilities of Advanced React DataTable through these comprehensive examples:
π― Basic Usage Demo
- Features: Basic table with sorting, filtering, and pagination
- Use Case: Simple data display with essential functionality
- Code: View Demo Code
π·οΈ Grouping & Aggregation Demo
- Features: Multi-level grouping with automatic summaries
- Use Case: Financial reports, sales analytics, data analysis
- Code: View Demo Code
π Pinned Columns Demo
- Features: Left/right pinned columns with proper shadows
- Use Case: Wide tables with important identifier columns
- Code: View Demo Code
βοΈ Inline Editing Demo
- Features: Cell editing with validation and type-specific editors
- Use Case: Admin panels, data entry forms, spreadsheet-like interfaces
- Code: View Demo Code
- Features: Complex filters, date ranges, numeric comparisons
- Use Case: Data exploration, reporting dashboards, search interfaces
- Code: View Demo Code
- Features: Performance optimization for large datasets
- Use Case: Big data applications, real-time monitoring, analytics
- Code: View Demo Code
- Features: Custom cell, header, and footer components
- Use Case: Branded interfaces, complex data visualization, custom UI
- Code: View Demo Code
- Features: CSV export, custom actions, bulk operations
- Use Case: Data export, administrative tools, workflow management
- Code: View Demo Code
| Prop | Type | Default | Description |
|---|---|---|---|
data |
T[] |
Required | Array of data objects to display |
columns |
DataTableColumn<T>[] |
Required | Column definitions array |
groupBy |
string | string[] |
undefined |
Fields to group by (supports multi-level) |
virtualScrolling |
boolean |
false |
Enable virtual scrolling for large datasets |
stickyHeader |
boolean |
true |
Keep header visible during scrolling |
stickyFooter |
boolean |
false |
Keep footer visible at bottom |
showFilters |
boolean |
true |
Show column filters in header |
showColumnConfig |
boolean |
true |
Show column configuration modal |
pageSize |
number |
10 |
Number of rows per page |
className |
string |
undefined |
Additional CSS classes for container |
enablePdfExport |
boolean |
false |
Enable PDF export button |
onRowSelect |
(rows: T[]) => void |
undefined |
Callback when rows are selected |
onExport |
(data: T[], format: 'csv' | 'pdf') => void |
undefined |
Callback for export actions |
onColumnChange |
(columns: DataTableColumn<T>[]) => void |
undefined |
Callback when columns change |
onCellEdit |
(row: T, field: keyof T, value: any) => void |
undefined |
Callback when cell is edited |
customActions |
React.ReactNode |
undefined |
Custom action components |
interface DataTableColumn<T> {
field: string // Field name from data object
header: string // Display name for column header
sortable?: boolean // Enable sorting (default: false)
filterable?: boolean // Enable filtering (default: false)
groupable?: boolean // Enable grouping (default: false)
pinned?: 'left' | 'right' | null // Pin column to side (default: null)
type?: 'text' | 'number' | 'date' | 'select' | 'boolean' // Data type
width?: string // Fixed column width
minWidth?: string // Minimum column width
maxWidth?: string // Maximum column width
hidden?: boolean // Hide column (default: false)
editable?: boolean // Enable inline editing (default: false)
useSelection?: boolean // Use checkbox for selection
aggregation?: 'count' | 'total' | 'avg' | 'min' | 'max' // Aggregation function
filterOptions?: string[] // Options for select filters
cellRenderer?: (value: any, row: T) => React.ReactNode // Custom cell renderer
headerRenderer?: (column: DataTableColumn<T>) => React.ReactNode // Custom header
footerRenderer?: (summary: any, rows: T[]) => React.ReactNode // Custom footer
valueGetter?: (row: T) => any // Custom value extraction
}The component is built with Tailwind CSS and provides extensive customization options:
// Custom row styling
<DataTable
data={employees}
columns={columns}
rowClassName={(row) =>
row.active ? 'bg-green-50 hover:bg-green-100' : 'bg-red-50 hover:bg-red-100'
}
/>
// Custom container styling
<DataTable
className="bg-white rounded-lg shadow-lg border border-gray-200"
// ... other props
/>const columns = [
{
field: 'status',
header: 'Status',
cellRenderer: (value, row) => (
<Badge variant={value === 'active' ? 'default' : 'destructive'}>
{value}
</Badge>
)
}
];Comprehensive test coverage ensures reliability:
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Run tests with UI
npm run test:uiTest Coverage Includes:
- β Core DataTable component
- β Filtering and sorting functionality
- β Grouping and hierarchical display
- β Pagination and data manipulation
- β Column configuration and management
- β Export functionality
- β Utility functions and helpers
Enable for datasets with 1000+ rows:
<DataTable
virtualScrolling={true}
data={largeDataset}
// ... other props
/>- Efficient re-renders with React.memo
- Debounced filter inputs
- Lazy loading for large datasets
- Optimized sorting algorithms
- Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: iOS Safari 14+, Chrome Mobile 90+
- Node.js: 18.x or higher
- Size: ~45KB gzipped (including Tailwind CSS utilities)
- Dependencies: React 18+, React DOM 18+
- Tree-shaking: Full support for optimal bundle sizes
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for your changes
- Ensure all tests pass (
npm test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.
- π Report bugs
- π‘ Request features
- π Documentation
- π¬ Discussions
- π§ Email support
- React Table - Headless table library
- AG Grid - Enterprise data grid
- Material-UI DataGrid - Material Design grid
Made with β€οΈ by the Advanced React DataTable team
Star this repository if you find it helpful!
