Components
The DS table adapted to the 360px minimum mobile viewport — one mobile table for every mobile table in the product, so they all look the same.
table-fixed, so the columns share the frame width and every value that does not fit its cell truncates with an ellipsis. Nothing is lost: the accessible name keeps the complete text, and MobileTableCell mirrors a string child into the native title tooltip (hover or long-press a truncated merchant).Últimas transações
Cartão •••• 4242
| Data | Estabelecimento | Valor | Status |
|---|---|---|---|
| 31 out | Padaria Pão de Queijo da Vila Madalena | R$ 42,90 | Confirmado |
| 31 out | Uber do Brasil Tecnologia Ltda. | R$ 78,50 | Pendente |
| 30 out | Supermercado Bom Preço Unidade Jardim Paulista | R$ 231,47 | Confirmado |
| 29 out | Farmácia São João Filial 1042 | R$ 96,20 | Confirmado |
Hover (or long-press) a truncated cell — the full value is kept as its title.
360 × 800 — minimum supported mobile viewport
import {
MobileTable,
MobileTableBody,
MobileTableCaption,
MobileTableCell,
MobileTableHead,
MobileTableHeader,
MobileTableRow,
} from "@workspace/ui/components/mobile-table"
<MobileTable>
<MobileTableCaption>Últimas transações do cartão.</MobileTableCaption>
<MobileTableHeader>
<MobileTableRow>
<MobileTableHead className="w-14">Data</MobileTableHead>
<MobileTableHead>Estabelecimento</MobileTableHead>
<MobileTableHead className="w-24 text-end">Valor</MobileTableHead>
<MobileTableHead className="w-24">Status</MobileTableHead>
</MobileTableRow>
</MobileTableHeader>
<MobileTableBody>
{transactions.map((transaction) => (
<MobileTableRow key={transaction.id}>
<MobileTableCell>{transaction.date}</MobileTableCell>
<MobileTableCell className="font-medium">
{transaction.merchant}
</MobileTableCell>
<MobileTableCell className="text-end">
{transaction.amount}
</MobileTableCell>
<MobileTableCell>{transaction.status}</MobileTableCell>
</MobileTableRow>
))}
</MobileTableBody>
</MobileTable>min-w-[480px] on MobileTable: the frame scrolls sideways inside itself — max-w-full keeps the frame within its parent and overscroll-x-contain stops the horizontal scroll from chaining into the page. The 360px page around it never stretches.| Data | Estabelecimento | Categoria | Valor | Status |
|---|---|---|---|---|
| 31 out | Padaria Pão de Queijo da Vila Madalena | Alimentação | R$ 42,90 | Confirmado |
| 31 out | Uber do Brasil Tecnologia Ltda. | Transporte | R$ 78,50 | Pendente |
| 30 out | Supermercado Bom Preço Unidade Jardim Paulista | Mercado | R$ 231,47 | Confirmado |
| 29 out | Farmácia São João Filial 1042 | Saúde | R$ 96,20 | Confirmado |
min-w-[480px] table — the frame scrolls sideways, the 360px page does not stretch
import {
MobileTable,
MobileTableBody,
MobileTableCell,
MobileTableHead,
MobileTableHeader,
MobileTableRow,
} from "@workspace/ui/components/mobile-table"
<MobileTable className="min-w-[480px]">
<MobileTableHeader>
<MobileTableRow>
<MobileTableHead className="w-16">Data</MobileTableHead>
<MobileTableHead>Estabelecimento</MobileTableHead>
<MobileTableHead className="w-24">Categoria</MobileTableHead>
<MobileTableHead className="w-24 text-end">Valor</MobileTableHead>
<MobileTableHead className="w-24">Status</MobileTableHead>
</MobileTableRow>
</MobileTableHeader>
<MobileTableBody>
{transactions.map((transaction) => (
<MobileTableRow key={transaction.id}>
<MobileTableCell>{transaction.date}</MobileTableCell>
<MobileTableCell className="font-medium">
{transaction.merchant}
</MobileTableCell>
<MobileTableCell>{transaction.category}</MobileTableCell>
<MobileTableCell className="text-end">
{transaction.amount}
</MobileTableCell>
<MobileTableCell>{transaction.status}</MobileTableCell>
</MobileTableRow>
))}
</MobileTableBody>
</MobileTable>Table. Only MobileTable adds structure, and only MobileTableCell adds behavior: a string child is mirrored into the native title attribute when no title prop is passed, so the full value of a truncated cell is one hover or long-press away.| Part | Renders |
|---|---|
| MobileTable | div > table |
| MobileTableHeader | thead |
| MobileTableBody | tbody |
| MobileTableFooter | tfoot |
| MobileTableRow | tr |
| MobileTableHead | th |
| MobileTableCell | td |
| MobileTableCaption | caption |
Tokens used
7 design tokens consumed by the Mobile Table component.
--muted
Muted
--foreground
Foreground
--muted-foreground
Muted Foreground
--border
Border
--text-sm
Text Small (14px)
--font-weight-medium
Font weight Medium (500)
--spacing
Spacing unit (4px)