Display
Table
SimpleTable adds a sticky header, hover rows and an optional card layout on small screens.
<script>
import { SimpleTable } from "@codeatlasdev/ui";
</script>
<SimpleTable responsive="cards">
<thead>…</thead>
<tbody>…</tbody>
</SimpleTable>
SimpleTable styles plain thead and tbody markup. For search, sorting and pagination use DataTable. In cards mode the header row stays available to screen readers.
Default (scroll)
A regular table at every width.
| Name | Role | Status | |
|---|---|---|---|
| Ana Souza | ana@example.com | Admin | Active |
| Bruno Lima | bruno@example.com | Editor | Invited |
| Carla Dias | carla@example.com | Viewer | Active |
Code
Cards on mobile
Below 900px each row becomes a card. Put `data-label` on every `td`; it is rendered as the field name. Resize the window to see it.
| Name | Role | Status | |
|---|---|---|---|
| Ana Souza | ana@example.com | Admin | Active |
| Bruno Lima | bruno@example.com | Editor | Invited |
| Carla Dias | carla@example.com | Viewer | Active |
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
responsive | 'scroll' | 'cards' | 'scroll' | `cards` turns each row into a card below the md breakpoint (900px). Requires `data-label` on each `td`. |
class | string | '' | Extra class on the wrapper. |
children | Snippet | undefined | `thead` and `tbody` markup. |