A structured way to display data in rows and columns.
Table is the thin, semantic primitive for static tabular content — invoice summaries, pricing matrices, reference tables in documentation. Rows and cells render exactly what you put in them; there is no sorting, filtering, selection, or pagination built in.
DataTable for dynamic, application data — anywhere users need to sort, filter, paginate, select, or click rows. DataTable is built on top of Table and powered by TanStack Table.Table directly only when your data is static and none of those behaviors apply.1import { Table } from "@ngrok/mantle/table";2 3<Table.Root>4 <Table.Element>5 <Table.Caption>A list of your recent invoices.</Table.Caption>6 <Table.Head>7 <Table.Row>8 <Table.Header className="w-25">Invoice</Table.Header>9 <Table.Header>Status</Table.Header>10 <Table.Header>Method</Table.Header>11 <Table.Header className="text-right">Amount</Table.Header>12 </Table.Row>13 </Table.Head>14 <Table.Body>15 {invoices.map((invoice) => (16 <Table.Row key={invoice.invoice}>17 <Table.Cell className="font-medium">{invoice.invoice}</Table.Cell>18 <Table.Cell>{invoice.paymentStatus}</Table.Cell>19 <Table.Cell>{invoice.paymentMethod}</Table.Cell>20 <Table.Cell className="text-right">{invoice.totalAmount}</Table.Cell>21 </Table.Row>22 ))}23 </Table.Body>24 <Table.Foot>25 <Table.Row>26 <Table.Cell colSpan={3}>Total</Table.Cell>27 <Table.Cell className="text-right">$2,500.00</Table.Cell>28 </Table.Row>29 </Table.Foot>30 </Table.Element>31</Table.Root>;Compose the parts of a Table together to build your own:
Table.Root└── Table.Element ├── Table.Caption ├── Table.Head │ └── Table.Row │ └── Table.Header ├── Table.Body │ └── Table.Row │ └── Table.Cell └── Table.FootThe Table is a structured way to display data in rows and columns. The API matches the HTML table element 1:1. It is composed of several sub-components.
Root container for all Table sub-components. Should be the parent of all other table sub-components. It provides styling and additional functionality, such as horizontal overflow detection.
All props from div.
The API matches the HTML table element 1:1.
Permitted content in this order:
Table.Captioncolgroup elementsTable.HeadTable.BodyTable.RowTable.FootAll props from table.
Container for the table's column headers. Encapsulates a set of Table.Rows, indicating that they comprise the head of a table with information about the table's columns.
All props from thead.
Encapsulates a set of Table.Rows, indicating that they comprise the body of a table's (main) data.
All props from tbody.
Encapsulates a set of Table.Rows, indicating that they comprise the foot of a table with information about the table's columns. This is usually a summary of the columns, e.g., a sum of the given numbers in a column.
All props from tfoot.
Defines a row of cells in a table. The row's cells can then be established using a mix of Table.Cell and Table.Header components.
All props from tr.
Defines a cell as the header of a group of table cells and may be used as a child of a Table.Row.
All props from th.
Defines a cell of a table that contains data and may be used as a child of a Table.Row.
All props from td.
Specifies the caption (or title) of a table, providing the table an accessible description.
All props from caption.