Hey Dev community! 👋
I've been developing React apps for years, and there's one component that has consistently been the bane of my existence: data tables.
We've all been there - you start with a simple table, then suddenly need to add sorting, then filtering, then pagination, then row selection, then... well, you get it. Before you know it, your "simple table" has ballooned into a complex state management nightmare with dozens of edge cases.
After integrating countless table libraries and always finding them either too bloated, too rigid, or missing critical features, I finally decided: "I'm going to build one that actually works the way developers need it to."
Today, I'm open-sourcing TNKS Data Table - a data table implementation I've been refining over countless projects that solves all these pain points.
Why Another Data Table Solution?
I know what you're thinking. "Just what the world needs, another data table component." 🙄
But hear me out - this one's actually different because it's built to solve real-world development challenges:
- True server-side operations - Most "server-side" table libraries still try to do too much in the browser
- Zero vendor lock-in - The backend is completely decoupled
- TypeScript all the way down - End-to-end type safety from API to UI
- Automatic API integration - Follows REST best practices with minimal configuration
- Modern stack - Built with Next.js, React 18+, Shadcn UI, Hono.js, and Drizzle ORM
The Features That Developers Actually Need
Here's what makes TNKS Data Table stand out:
<DataTable<User, any>
getColumns={getColumns}
exportConfig={useExportConfig()}
fetchDataFn={useUsersData}
fetchByIdsFn={fetchUsersByIds}
idField="id"
pageSizeOptions={[10, 20, 50, 100]}
renderToolbarContent={({ selectedRows, allSelectedIds, totalSelectedCount }) => (
<ToolbarOptions
selectedUsers={selectedRows}
allSelectedIds={allSelectedIds}
totalSelectedCount={totalSelectedCount}
/>
)}
config={{
enableRowSelection: true,
enableSearch: true,
enableDateFilter: true,
enableColumnVisibility: true,
enableUrlState: true,
columnResizingTableId: "user-table",
}}
/>
💪 Powerful Yet Simple API
Just look at that component - almost declarative in its simplicity, yet packing every feature you'd need:
- Server-side pagination
- Server-side sorting
- Server-side filtering
- Cross-page row selection
- URL state persistence
- Column resizing with persistence
- Column visibility toggles
- Data export (CSV/Excel)
- Custom toolbar actions
- Responsive design
🔌 Plug-and-Play Backend Integration
The backend integration is where TNKS Data Table really shines. It's built to work with any backend that follows our simple API patterns:
// Sample API response format
{
"success": true,
"data": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"created_at": "2025-01-15T10:30:00Z"
}
// more items...
],
"pagination": {
"page": 1,
"limit": 10,
"total_pages": 5,
"total_items": 48
}
}
Built With Modern Technologies You Already Love
The stack is probably what you're already using (or wanting to use):
- Frontend: Next.js, React 18+, TypeScript, TanStack Table & Query, Shadcn UI
- Backend: Hono.js (ultra-fast API framework), Drizzle ORM (type-safe query builder)
- Database: Works with any - PostgreSQL implementation included
Real-World Use Case
Let me share a real scenario where this saved me weeks of development time.
I was building an admin dashboard that needed to display user data with:
- Complex filtering based on multiple fields
- Selection of users across different pages for bulk operations
- Exporting filtered results to Excel
- Responsive layout for mobile and desktop
- URL state for shareable filtered views
Before TNKS Data Table: This would have required custom state management, API integration, UI components, URL state synchronization, and countless edge case handling.
With TNKS Data Table: It took less than 300 lines of code total, including the backend API endpoints, and worked perfectly on the first try.
Performance That Scales
This isn't just another pretty UI component. It's built for performance:
- Server-side operations mean the browser doesn't choke on large datasets
- Pagination happens at the database level
- Batch operations prevent API request storms
- Optimized rendering prevents unnecessary re-renders
- Virtualization support coming soon (currently WIP)
How to Get Started
Getting started is straightforward:
- Clone or fork the repository:
git clone https://github.com/jacksonkasi1/tnks-data-table.git
-
Follow the README.md instructions:
- Copy the
/components/data-table
directory to your project - Install required dependencies (Shadcn UI, TanStack Table, React Query, etc.)
- Set up your API endpoints following our API patterns
- Copy the
Implement in your project:
import { DataTable } from '@/components/data-table/data-table';
import { getColumns } from './columns';
import { useUsersData } from './data-fetching';
export default function UsersTable() {
return (
<DataTable
getColumns={getColumns}
fetchDataFn={useUsersData}
idField="id"
config={{
enableSearch: true,
enableDateFilter: true,
enableSorting: true,
}}
/>
);
}
Imaginary Future Fan Club 🔮
Since this is a brand new project, here's what I imagine developers might say once they try it:
"My therapist asked why I stopped attending our sessions about data table frustration. I showed her TNKS Data Table and now she's using it too!" - Future Frontend Dev
"I was about to sacrifice my mechanical keyboard to the coding gods out of table-related despair, but then I found this. My keyboard thanks you." - Yet-to-exist Full Stack Engineer
"My boss asked why I finished the admin panel three days early. I'm keeping TNKS Data Table my little secret so they think I'm a wizard!" - Potential React Developer
Join the future fan club by trying it out and leaving your real feedback! 😉
Open Source and Built for the Community
TNKS Data Table is fully open source, MIT licensed, and built in the open. We welcome contributions, whether it's:
- Bug reports
- Feature requests
- PRs for new features
- Documentation improvements
Check out our GitHub repository and give us a star if you find it useful!
The Roadmap Ahead
We're just getting started. Here's what's coming:
- Row virtualization (currently in progress)
- Tree table support
- More export formats
- Custom filter builders
- Enhanced mobile experience
- Additional backend examples (Express, NestJS, FastAPI)
- Drag and drop column reordering
Try It Today
If you've made it this far, you're probably tired of fighting with data tables just like I was. Give TNKS Data Table a try and reclaim those development hours for more interesting challenges.
This isn't a package you install - it's a pattern and implementation you can copy into your project and customize to fit your needs perfectly. The real value is in the architecture and the approach.
Let me know what you think in the comments! And if you use it in your projects, I'd love to hear about your experience.
Happy coding! 👨💻
P.S. If you found this useful, consider giving the repo a star on GitHub. It helps others discover the project!
Top comments (2)
Amazing build, brother. idk where I will use it but Im saving it as it will be helpful down the line. very neat and high quality implementation
@thesohailjafri Thanks for the kind words, Sohail! Really appreciate it. 🙌
I built this table component after struggling with similar challenges across multiple projects. My company works on many CMS platforms or similar systems where data tables are absolutely central to the user experience
We tried numerous templates and open-source solutions, but kept running into limitations. I really liked sadmann7's shadcn-table, but it has some constraints - it only works with Drizzle ORM and relies heavily on Next.js server actions, making it difficult to separate backend and frontend cleanly. This becomes challenging when maintaining larger projects, and the customization options were somewhat limited.
I also looked at this shadcn datatable implementation and ultimately decided to build my own solution that addresses these specific pain points while keeping the API clean and developer-friendly.
There are still some features on my roadmap (like data export customization controls, virtualization for extremely large datasets, etc.) that I'll be adding when I have more time.
Feel free to reach out if you end up using it in any of your projects or have suggestions for improvements! 😊