Collaboration
Project Management
Finance
Table
Table views are used to display data in a tabular format. They are useful for displaying large amounts of data in a structured way.
Installation
npx love-ui@latest add tableUsage
import { TableProvider, TableHeader, TableHeaderGroup, TableHead, TableBody, TableRow, TableCell, TableColumnHeader, type ColumnDef } from "@/components/table"const columns: ColumnDef<Data>[] = [
{
accessorKey: "name",
header: ({ column }) => <TableColumnHeader column={column} title="Name" />,
},
// ... more columns
]
<TableProvider columns={columns} data={data}>
<TableHeader>
{(headerGroup) => (
<TableHeaderGroup key={headerGroup.id}>
{headerGroup.headers.map((header) => (
<TableHead key={header.id} header={header} />
))}
</TableHeaderGroup>
)}
</TableHeader>
<TableBody>
{(row) => (
<TableRow key={row.id} row={row}>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id} cell={cell} />
))}
</TableRow>
)}
</TableBody>
</TableProvider>Features
- Customizable columns
- Sortable columns
Examples
Simple version
| Repurpose B2B methodologies | In Progress | Grow innovative technologies | Sep 30, 2025 | Dec 21, 2025 | Unleash holistic markets |
| Orchestrate proactive functionalities | Planned | Utilize quantum schemas | Jun 10, 2025 | Jan 31, 2026 | Drive killer relationships |
| Maximize leading-edge schemas | Done | Grow innovative technologies | May 27, 2025 | Nov 7, 2025 | Drive killer relationships |
| Innovate decentralized models | Planned | Exploit ubiquitous solutions | Aug 30, 2025 | Mar 8, 2026 | Drive killer relationships |
| Scale dynamic initiatives | Planned | Architect ubiquitous AI | Jun 28, 2025 | Mar 6, 2026 | Unleash holistic markets |
| Engage decentralized partnerships | Planned | Grow innovative technologies | Aug 5, 2025 | Jan 5, 2026 | Productize B2C experiences |
| Unleash killer infrastructures | Planned | Utilize quantum schemas | Sep 3, 2025 | Dec 22, 2025 | Drive killer relationships |
| Incentivize distributed AI | Planned | Utilize quantum schemas | Jul 14, 2025 | Feb 28, 2026 | Drive killer relationships |
| Implement turn-key partnerships | In Progress | Grow innovative technologies | Oct 18, 2025 | Mar 24, 2026 | Unleash holistic markets |
| Whiteboard global deliverables | In Progress | Utilize quantum schemas | Jul 11, 2025 | Jan 8, 2026 | Unleash holistic markets |
| Engineer revolutionary infrastructures | Planned | Grow innovative technologies | May 9, 2025 | Dec 30, 2025 | Unleash holistic markets |
| Productize B2B technologies | In Progress | Grow innovative technologies | Jun 20, 2025 | Dec 4, 2025 | Productize B2C experiences |
| Engineer world-class synergies | Done | Exploit ubiquitous solutions | Jun 7, 2025 | Dec 10, 2025 | Productize B2C experiences |
| Disintermediate holistic platforms | In Progress | Exploit ubiquitous solutions | Jul 15, 2025 | Nov 14, 2025 | Unleash holistic markets |
| Synthesize smart supply-chains | Planned | Architect ubiquitous AI | Aug 2, 2025 | Mar 17, 2026 | Unleash holistic markets |
| Strategize killer users | Planned | Grow innovative technologies | Sep 5, 2025 | Feb 23, 2026 | Drive killer relationships |
| Scale front-end methodologies | Done | Exploit ubiquitous solutions | Jun 11, 2025 | Nov 7, 2025 | Unleash holistic markets |
| Iterate cross-media markets | In Progress | Architect ubiquitous AI | Jun 27, 2025 | Apr 8, 2026 | Drive killer relationships |
| Integrate revolutionary applications | Done | Architect ubiquitous AI | May 29, 2025 | Jan 13, 2026 | Drive killer relationships |
| Brand transparent mindshare | Planned | Architect ubiquitous AI | Jun 16, 2025 | Jan 30, 2026 | Drive killer relationships |
"use client";
import { faker } from "@faker-js/faker";
import type { ColumnDef } from "../../../../../packages/table";
import {
TableBody,
TableCell,
TableColumnHeader,
TableHead,
TableHeader,
TableHeaderGroup,
TableProvider,
TableRow,
} from "../../../../../packages/table";
// Seed faker to ensure consistent data between server and client
faker.seed(123);
const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
const statuses = [
{ id: faker.string.uuid(), name: "Planned", color: "#6B7280" },
{ id: faker.string.uuid(), name: "In Progress", color: "#F59E0B" },
{ id: faker.string.uuid(), name: "Done", color: "#10B981" },
];
const users = Array.from({ length: 4 })
.fill(null)
.map(() => ({
id: faker.string.uuid(),
name: faker.person.fullName(),
image: faker.image.avatar(),
}));
const exampleProducts = Array.from({ length: 4 })
.fill(null)
.map(() => ({
id: faker.string.uuid(),
name: capitalize(faker.company.buzzPhrase()),
}));
const exampleInitiatives = Array.from({ length: 2 })
.fill(null)
.map(() => ({
id: faker.string.uuid(),
name: capitalize(faker.company.buzzPhrase()),
}));
const exampleReleases = Array.from({ length: 3 })
.fill(null)
.map(() => ({
id: faker.string.uuid(),
name: capitalize(faker.company.buzzPhrase()),
}));
const exampleFeatures = Array.from({ length: 20 })
.fill(null)
.map(() => ({
id: faker.string.uuid(),
name: capitalize(faker.company.buzzPhrase()),
startAt: faker.date.past({ years: 0.5, refDate: new Date() }),
endAt: faker.date.future({ years: 0.5, refDate: new Date() }),
status: faker.helpers.arrayElement(statuses),
owner: faker.helpers.arrayElement(users),
product: faker.helpers.arrayElement(exampleProducts),
initiative: faker.helpers.arrayElement(exampleInitiatives),
release: faker.helpers.arrayElement(exampleReleases),
}));
const Example = () => {
const columns: ColumnDef<(typeof exampleFeatures)[number]>[] = [
{
accessorKey: "name",
header: ({ column }) => (
<TableColumnHeader column={column} title="Name" />
),
},
{
accessorKey: "status",
header: ({ column }) => (
<TableColumnHeader column={column} title="Status" />
),
cell: ({ row }) => row.original.status.name,
},
{
accessorKey: "product",
header: ({ column }) => (
<TableColumnHeader column={column} title="Product" />
),
cell: ({ row }) => row.original.product.name,
},
{
accessorKey: "startAt",
header: ({ column }) => (
<TableColumnHeader column={column} title="Start At" />
),
cell: ({ row }) =>
new Intl.DateTimeFormat("en-US", {
dateStyle: "medium",
}).format(row.original.startAt),
},
{
accessorKey: "endAt",
header: ({ column }) => (
<TableColumnHeader column={column} title="End At" />
),
cell: ({ row }) =>
new Intl.DateTimeFormat("en-US", {
dateStyle: "medium",
}).format(row.original.endAt),
},
{
id: "release",
accessorFn: (row) => row.release.id,
header: ({ column }) => (
<TableColumnHeader column={column} title="Release" />
),
cell: ({ row }) => row.original.release.name,
},
];
return (
<TableProvider columns={columns} data={exampleFeatures}>
<TableHeader>
{({ headerGroup }) => (
<TableHeaderGroup headerGroup={headerGroup} key={headerGroup.id}>
{({ header }) => <TableHead header={header} key={header.id} />}
</TableHeaderGroup>
)}
</TableHeader>
<TableBody>
{({ row }) => (
<TableRow key={row.id} row={row}>
{({ cell }) => <TableCell cell={cell} key={cell.id} />}
</TableRow>
)}
</TableBody>
</TableProvider>
);
};
export default Example;