ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Table

A responsive table component.

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
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$2,500.00

Installation#

npx shadcn@latest add @rescript-shadcn/Table

Usage#

<Table>
  <Table.Caption> {"A list of your recent invoices."->React.string} </Table.Caption>
  <Table.Header>
    <Table.Row>
      <Table.Head className="w-[100px]"> {"Invoice"->React.string} </Table.Head>
      <Table.Head> {"Status"->React.string} </Table.Head>
      <Table.Head> {"Method"->React.string} </Table.Head>
      <Table.Head className="text-right"> {"Amount"->React.string} </Table.Head>
    </Table.Row>
  </Table.Header>
  <Table.Body>
    <Table.Row>
      <Table.Cell className="font-medium"> {"INV001"->React.string} </Table.Cell>
      <Table.Cell> {"Paid"->React.string} </Table.Cell>
      <Table.Cell> {"Credit Card"->React.string} </Table.Cell>
      <Table.Cell className="text-right"> {"$250.00"->React.string} </Table.Cell>
    </Table.Row>
  </Table.Body>
</Table>

Examples#

Footer#

Use the <TableFooter /> component to add a footer to the table.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
Total$2,500.00

Actions#

A table showing actions for each row using a <DropdownMenu /> component.

ProductPriceActions
Wireless Mouse$29.99
Mechanical Keyboard$129.99
USB-C Hub$49.99

Data Table#

You can use the <Table /> component to build more complex data tables. Combine it with @tanstack/react-table to create tables with sorting, filtering and pagination.

See the Data Table documentation for more information.

You can also see an example of a data table in the Tasks demo.

type invoice = {
  invoice: string,
  paymentStatus: string,
type invoice = {
  invoice: string,
  paymentStatus: string,
@react.component
let make = () =>
  <Table>