TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM/llms.txt
Use this file to discover all available pages before exploring further.
Table component turns a columns definition and a rows array into a fully responsive data table. On screens wider than the md Tailwind breakpoint it renders a standard HTML <table>; on smaller screens it automatically switches to a stacked card layout so every row is readable without horizontal scrolling. Both views share the same columns and actions configuration — you define your data shape once and both layouts render from it.
Props
Ordered array of column descriptor objects. Each object controls both the header label and the row data key.
| Property | Type | Description |
|---|---|---|
label | string | Text shown in the <th> header and as the field label in the mobile card. |
key | string | Property name read from each row object. Falls back to '-' when the value is falsy. |
Array of plain objects. Each object must contain a property for every
key declared in columns. Extra properties are ignored by the renderer but are available inside the actions callback.The
id attribute written onto the <tbody> element in the desktop table view. Useful when you need to update table rows in-place via document.getElementById(tbodyId).Text shown inside a centred empty-state block when
rows is empty or undefined. The empty state renders a large inbox icon above the message.Optional callback invoked once per row:
(row) => htmlString. The returned HTML is injected into an Acciones column on desktop and into a flex-wrap footer strip on mobile. Return an empty string to suppress the column for a specific row.Column definition — USER_COLUMNS from users.page.js
Complete usage example
The following is taken directly fromusers.page.js and shows columns, rows, a custom tbodyId, and per-row action buttons:
Responsive design
Table renders two sibling HTML structures from the same data:
Desktop — hidden below md breakpoint
A standard
<table> wrapped in an overflow-x-auto scroll container. Headers use sticky positioning (sticky top-0) so they remain visible when the table scrolls vertically. Odd rows receive a subtle alternate background. The actions column header is labelled Acciones and its cells are centre-aligned.Mobile — hidden above md breakpoint
Each row becomes a rounded card with
border border-gray-700/60. Column values are stacked vertically with their label shown in bold uppercase above the value. Long values (over 40 characters) wrap rather than truncate. Action buttons are rendered in a flex-wrap strip separated from the data by a top border.Both the desktop
<table> and the mobile cards are always present in the DOM. Visibility is controlled exclusively by the Tailwind hidden / md:block / md:hidden utility classes, so no JavaScript is required to switch between layouts on resize.Updating the table after a data change
BecauseTable returns a plain HTML string, the recommended pattern for refreshing data is to re-render the entire component and replace the wrapper element: