I'll create a complete data table example using shadcn/ui and TanStack Table with filtering, sorting, pagination, and row selection.
This data table example includes all the requested features 1:
Filtering:
Sorting:
Pagination:
Row Selection:
Install the required dependencies:
npm install @tanstack/react-tableMake sure you have the shadcn/ui components installed:
npx shadcn@latest add table button input dropdown-menu select badgeCopy the files into your project structure:
data-table.tsx - Main table componentcolumns.tsx - Column definitionsdata-table-pagination.tsx - Pagination componentdata.tsx - Sample datapage.tsx - Page component that uses the tableDataTable component in your page.The table is fully responsive and follows accessibility best practices with proper ARIA labels and keyboard navigation support.