GooseUI

Components

Table

New

Table parts with the same names as in shadcn/ui, rendered on the server as plain <table> markup with no JavaScript. A table wider than its box scrolls inside its container: the scrollbar stays visible, the edge that hides content fades out, and browsers with ::scroll-button() draw round arrow buttons. For sorting, search and pagination use Data Table.

Browser Support

Limited availability
2 features
Details
Scroll-driven animations

Fades the edge that hides more columns. Without it there is no fade, the scrollbar still shows that the table scrolls.

Your browser:
::scroll-button

Round arrow buttons on the edges, drawn by the browser. Without them scroll with the scrollbar, Shift + wheel or a trackpad.

Your browser:

Preview

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank transfer$350.00
INV004PaidCredit card$450.00
INV005PaidPayPal$550.00
Total$1,750.00

Installation

npx shadcn@latest add @gooseui/table
pnpm dlx shadcn@latest add @gooseui/table
yarn dlx shadcn@latest add @gooseui/table
bunx --bun shadcn@latest add @gooseui/table

Usage

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table"

export default function Example() {
  return (
    <Table>
      <TableCaption>A list of your recent invoices.</TableCaption>
      <TableHeader>
        <TableRow>
          <TableHead className="w-24">Invoice</TableHead>
          <TableHead>Status</TableHead>
          <TableHead className="text-right">Amount</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell className="font-medium">INV001</TableCell>
          <TableCell>Paid</TableCell>
          <TableCell className="text-right">$250.00</TableCell>
        </TableRow>
      </TableBody>
    </Table>
  )
}

Examples

Wide table

In a narrow container the table scrolls sideways. Arrows and fades appear only on the side that has more to show.

RegionCityCPUMemoryUptimeLatencyVersion
eu-central-1Frankfurt8 vCPU32 GB99.99%41 msv2.14.0
us-east-1Virginia16 vCPU64 GB99.95%88 msv2.14.0
ap-south-1Mumbai4 vCPU16 GB99.90%132 msv2.13.2
<div className="max-w-sm">
  <Table scrollLeftLabel="Scroll left" scrollRightLabel="Scroll right">
    …
  </Table>
</div>

Selected row

data-state="selected" on TableRow highlights it, the same attribute shadcn/ui uses.

InvoiceStatusAmount
INV001Paid$250.00
INV002Pending$150.00
INV003Unpaid$350.00
<TableRow data-state="selected">…</TableRow>

Props

PropTypeDefaultDescription
containerClassNamestring-Classes for the scroll container, e.g. a max height (Table)
scrollLeftLabelstring"Scroll left"Accessible name of the left scroll button (Table)
scrollRightLabelstring"Scroll right"Accessible name of the right scroll button (Table)
data-state"selected"-"selected" highlights the row (TableRow)
classNamestring-Additional CSS classes on any part
...propsReact.ComponentProps<…>-Every part accepts the attributes of its HTML element