Skip to content

TableLoading

Open .md
Live preview

Loading example…

Placeholder rows for the first load. The rows are decorative; one status region announces the load.

import { TableLoading } from "@jcsoftdev/ui/containers";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/table.

<TableLoading aria-label="Inventario de productos">
<>
<TableHead>
<tr>
<TableHeaderCell>Producto</TableHeaderCell>
<TableHeaderCell>SKU</TableHeaderCell>
<TableHeaderCell alignRight>Stock</TableHeaderCell>
<TableHeaderCell alignRight>Precio</TableHeaderCell>
</tr>
</TableHead>
<TableBody>
{inventory.map((item) => (
<TableRow key={item.sku}>
<TableCell>
{item.name} {item.low ? <Chip tone="danger">Stock bajo</Chip> : null}
</TableCell>
<TableCell>{item.sku}</TableCell>
<TableCell alignRight>{item.stock}</TableCell>
<TableCell alignRight>{item.price}</TableCell>
</TableRow>
))}
</TableBody>
</>
</TableLoading>
Prop Type Default Description
columns * number Number of columns of the table.
rows number 5 Placeholder rows. Default 5.
label string Text announced to screen readers. Defaults to the localized “Loading”.

* marks a required prop.

packages/ui/src/containers/table/table-parts.tsx