DEV Community

Jackson Kasi
Jackson Kasi Subscriber

Posted on

I Bet Your Table Code is 200+ Lines. Prove Me Wrong. 😏

Let Me Prove I'm Right

I'm making a bet. Your table code has:

  1. Column definitions (manually written)
  2. Filter logic
  3. Sort logic
  4. Pagination state
  5. API connection
  6. Loading states
  7. URL sync
  8. Export functionality

That's 200+ lines minimum. I've seen projects with 600+.

Don't believe me? Go count yours right now. I'll wait. ☕️


Why This Happens

TanStack Table is incredible. Headless, flexible, powerful.

But that's the trap. It gives you primitives. You still have to:

  • Map your schema to columns
  • Build filter/sort/pagination UI
  • Connect server-side logic
  • Handle URL state
  • Add export functionality

That's not TanStack's fault. It's headless by design.

I know because I did this for 3 years.


I Got Tired of Being a Boilerplate Factory

So I built TableCraft — a layer on top of TanStack Table that generates everything from your Drizzle schema.

// Backend: Connect schema, get full API
const users = defineTable(schema.users)
  .hide('password')
  .search('email', 'name')
  .sort('-createdAt')

// Frontend: One component, done
<DataTable adapter={createTableCraftAdapter({ table: 'users' })} />
Enter fullscreen mode Exit fullscreen mode

What you get:

  • ✅ Auto-generated columns from schema
  • ✅ Server-side filtering, sorting, pagination
  • ✅ Search, export, date pickers
  • ✅ URL state sync
  • ✅ TypeScript types

All powered by TanStack Table under the hood.

Challenge for You 💪

Go check your last project.

Count the lines of table-related code (columns, filters, pagination, API routes).

Highest I've seen: 600+ lines. Beat that. 🏆

Comment below with:

  1. Lines of code
  2. Hours spent
  3. Would you use a tool that auto-generates this?

I'll go first: 340 lines, 4 hours, and yes I built the tool.

Your turn. 👇


Links:

Top comments (0)