Table
Powerful responsive data table with sticky headers, smooth scrolling, sorting, and pagination.
Loading...
Installation
npx shadcn@latest add @scrollxui/table Usage
// Basic Usage
import {
Table,
TableBody,
TableCaption,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/components/ui/table';<Table>
<TableCaption>A list of your recent invoices.</TableCaption>
<TableHeader>
<TableRow>
<TableHead className='w-25'>Invoice</TableHead>
<TableHead>Status</TableHead>
<TableHead>Method</TableHead>
<TableHead className='text-right'>Amount</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell className='font-medium'>INV001</TableCell>
<TableCell>Paid</TableCell>
<TableCell>Credit Card</TableCell>
<TableCell className='text-right'>$250.00</TableCell>
</TableRow>
</TableBody>
</Table>// DataTable Example
<DataTable
columns={[
{ accessorKey: 'invoice', header: createSortableHeader('Invoice') },
{ accessorKey: 'status', header: 'Status' },
{ accessorKey: 'method', header: 'Method' },
{
accessorKey: 'amount',
header: 'Amount',
cell: ({ row }) => `$${row.original.amount}`,
},
]}
data={[
{ invoice: 'INV001', status: 'Paid', method: 'Credit Card', amount: 250 },
{ invoice: 'INV002', status: 'Pending', method: 'PayPal', amount: 150 },
]}
pageSize={5}
searchable
pagination
/>Examples
DataTable
Loading...
Scrollable
Loading...
Checkbox
Loading...
API Reference
Table
Powerful responsive data table with sticky headers, smooth scrolling, sorting, and pagination.