Tables

Data tables for admin lists, reports, and structured record views.

Tables

Admin lists use shadcn Table primitives and the shared DataTable wrapper from @/components/Tables, powered by TanStack Table.

import { DataTable } from '@/components/Tables/data-table';
import useTable from '@/hooks/use-table';

const table = useTable({ data: members, columns });
<DataTable table={table} />

Shadcn Table

Base table primitives for static markup and custom layouts.

NameStatus
Alexandru PopescuActive
Maria IonescuPending
Andrei DumitrescuInactive

Basic table

<Table> <TableHeader> <TableRow> <TableHead>Name</TableHead> <TableHead>Status</TableHead> </TableRow> </TableHeader> <TableBody>...</TableBody> </Table>
Club members
Registry and license status overview.
NameFIDE IDStatus
Alexandru Popescu12345678Active
Maria Ionescu87654321Pending
Andrei Dumitrescu11223344Inactive

Card wrapper

<Card className="overflow-hidden"> <CardHeader className="border-b">Club members</CardHeader> <CardContent className="p-0"> <Table>...</Table> </CardContent> </Card>

Data table

TanStack Table with the shared DataTable component from @/components/Tables.

NameFIDE IDBirth dateClubCityFIDE ratingTitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategoryJoinedActions
Alexandru Popescu1234567814.03.1998CSU ASE BucharestBucharest2145FMRapidSicilian DefenseWhiteROURO-2021-0142ActiveSenior12.01.2024
Maria Ionescu8765432122.07.2010ACS TimișoaraTimișoara1680BlitzQueen's GambitBlackROURO-2023-0891PendingJunior03.02.2024
Andrei Dumitrescu1122334405.11.1985CSM ClujCluj-Napoca1987CMClassicalRuy LopezWhiteROURO-2018-0034InactiveSenior18.03.2023
Elena Vasilescu5566778819.09.1995CSU ASE BucharestBucharest2210WFMRapidCaro-KannBlackROURO-2020-0567ActiveOpen25.04.2024
Cristian Marin9988776601.02.1979CS Gloria BuzăuBuzău2055NMClassicalKing's IndianBlackROURO-2015-0118ActiveSenior09.05.2024
Ioana Georgescu4455667730.06.2012ACS IașiIași1542BlitzItalian GameWhiteROURO-2024-1203PendingJunior14.06.2024
Mihai Stan3344556617.12.2001CSU ASE BucharestBucharest1893RapidLondon SystemWhiteROURO-2022-0445ActiveOpen21.07.2024
Diana Popa2233445508.04.1990CSM BrașovBrașov2078WCMClassicalFrench DefenseBlackROURO-2019-0276InactiveSenior02.08.2023

0 of 8 row(s) selected.

Members list

const [columnVisibility, setColumnVisibility] = useState({}); const [rowSelection, setRowSelection] = useState({}); const table = useReactTable({ data: members, columns: getMemberColumns({ withSelection: true }), getCoreRowModel: getCoreRowModel(), getRowId: (row) => String(row.id), enableRowSelection: true, state: { columnVisibility, rowSelection }, onColumnVisibilityChange: setColumnVisibility, onRowSelectionChange: setRowSelection, }); <div className="flex items-center justify-end"> <DataTableViewOptions table={table} /> </div> <DataTable table={table} />
NameFIDE IDBirth dateClubCityFIDE ratingTitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategoryJoinedActions

0 of 8 row(s) selected.

Loading state

<DataTable table={table} loading={true} />
NameFIDE IDBirth dateClubCityFIDE ratingTitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategoryJoinedActions
No results.

0 of 0 row(s) selected.

Empty state

<DataTable table={table} /> // with data: []

Features

Sorting and column controls used in admin lists.

ClubCity
TitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategory
Actions
Alexandru Popescu1234567814.03.1998CSU ASE BucharestBucharest2145FMRapidSicilian DefenseWhiteROURO-2021-0142ActiveSenior12.01.2024
Maria Ionescu8765432122.07.2010ACS TimișoaraTimișoara1680BlitzQueen's GambitBlackROURO-2023-0891PendingJunior03.02.2024
Andrei Dumitrescu1122334405.11.1985CSM ClujCluj-Napoca1987CMClassicalRuy LopezWhiteROURO-2018-0034InactiveSenior18.03.2023
Elena Vasilescu5566778819.09.1995CSU ASE BucharestBucharest2210WFMRapidCaro-KannBlackROURO-2020-0567ActiveOpen25.04.2024
Cristian Marin9988776601.02.1979CS Gloria BuzăuBuzău2055NMClassicalKing's IndianBlackROURO-2015-0118ActiveSenior09.05.2024
Ioana Georgescu4455667730.06.2012ACS IașiIași1542BlitzItalian GameWhiteROURO-2024-1203PendingJunior14.06.2024
Mihai Stan3344556617.12.2001CSU ASE BucharestBucharest1893RapidLondon SystemWhiteROURO-2022-0445ActiveOpen21.07.2024
Diana Popa2233445508.04.1990CSM BrașovBrașov2078WCMClassicalFrench DefenseBlackROURO-2019-0276InactiveSenior02.08.2023

0 of 8 row(s) selected.

Sortable columns

header: ({ column }) => ( <DataTableColumnHeader column={column} title="Name" /> )
NameFIDE IDBirth dateClubCityFIDE ratingTitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategoryJoinedActions
Alexandru Popescu1234567814.03.1998CSU ASE BucharestBucharest2145FMRapidSicilian DefenseWhiteROURO-2021-0142ActiveSenior12.01.2024
Maria Ionescu8765432122.07.2010ACS TimișoaraTimișoara1680BlitzQueen's GambitBlackROURO-2023-0891PendingJunior03.02.2024
Andrei Dumitrescu1122334405.11.1985CSM ClujCluj-Napoca1987CMClassicalRuy LopezWhiteROURO-2018-0034InactiveSenior18.03.2023
Elena Vasilescu5566778819.09.1995CSU ASE BucharestBucharest2210WFMRapidCaro-KannBlackROURO-2020-0567ActiveOpen25.04.2024
Cristian Marin9988776601.02.1979CS Gloria BuzăuBuzău2055NMClassicalKing's IndianBlackROURO-2015-0118ActiveSenior09.05.2024
Ioana Georgescu4455667730.06.2012ACS IașiIași1542BlitzItalian GameWhiteROURO-2024-1203PendingJunior14.06.2024
Mihai Stan3344556617.12.2001CSU ASE BucharestBucharest1893RapidLondon SystemWhiteROURO-2022-0445ActiveOpen21.07.2024
Diana Popa2233445508.04.1990CSM BrașovBrașov2078WCMClassicalFrench DefenseBlackROURO-2019-0276InactiveSenior02.08.2023

0 of 8 row(s) selected.

Row selection

const [rowSelection, setRowSelection] = useState({}); const table = useReactTable({ data: members, columns: getMemberColumns({ withSelection: true }), getCoreRowModel: getCoreRowModel(), getRowId: (row) => String(row.id), enableRowSelection: true, state: { rowSelection }, onRowSelectionChange: setRowSelection, }); <DataTable table={table} />
NameFIDE IDBirth dateClubCityFIDE ratingTitlePreferred formatFavorite openingPreferred colorFederationLicense no.StatusCategoryJoinedActions
Alexandru Popescu1234567814.03.1998CSU ASE BucharestBucharest2145FMRapidSicilian DefenseWhiteROURO-2021-0142ActiveSenior12.01.2024
Maria Ionescu8765432122.07.2010ACS TimișoaraTimișoara1680BlitzQueen's GambitBlackROURO-2023-0891PendingJunior03.02.2024
Andrei Dumitrescu1122334405.11.1985CSM ClujCluj-Napoca1987CMClassicalRuy LopezWhiteROURO-2018-0034InactiveSenior18.03.2023
Elena Vasilescu5566778819.09.1995CSU ASE BucharestBucharest2210WFMRapidCaro-KannBlackROURO-2020-0567ActiveOpen25.04.2024
Cristian Marin9988776601.02.1979CS Gloria BuzăuBuzău2055NMClassicalKing's IndianBlackROURO-2015-0118ActiveSenior09.05.2024
Ioana Georgescu4455667730.06.2012ACS IașiIași1542BlitzItalian GameWhiteROURO-2024-1203PendingJunior14.06.2024
Mihai Stan3344556617.12.2001CSU ASE BucharestBucharest1893RapidLondon SystemWhiteROURO-2022-0445ActiveOpen21.07.2024
Diana Popa2233445508.04.1990CSM BrașovBrașov2078WCMClassicalFrench DefenseBlackROURO-2019-0276InactiveSenior02.08.2023

0 of 8 row(s) selected.

Column visibility

const [columnVisibility, setColumnVisibility] = useState({}); const table = useReactTable({ data: members, columns, getCoreRowModel: getCoreRowModel(), state: { columnVisibility }, onColumnVisibilityChange: setColumnVisibility, }); <DataTableViewOptions table={table} /> <DataTable table={table} />