Table
A framed data table with a rule under the header and an optional footer row for totals.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphTable } from '@fractaldesign/machines-ui';Preview
| Agent | Tokens | Tool calls | Time |
|---|---|---|---|
| Inks and paper | 115,207 | 120 | 16m |
| Overprint and drift | 135,218 | 164 | 16m |
| Naming the patterns | 186,716 | 112 | 18m |
| Total | 437,141 | 396 | ~50m |
<GraphTable
title="WHAT THE RESEARCH COST"
headers={['Agent', 'Tokens', 'Tool calls', 'Time']}
align={['left', 'right', 'right', 'right']}
rows={[
['Inks and paper', '115,207', '120', '16m'],
['Overprint and drift', '135,218', '164', '16m'],
['Naming the patterns', '186,716', '112', '18m']
]}
footer={['Total', '437,141', '396', '~50m']}
/>| Decision | Reason |
|---|---|
| ease-out on enter | feels snappier |
| 180ms, not 400ms | feels faster, more responsive |
| springs for gestures | they carry your momentum |
| scale 0.97 on press | it makes the UI feel alive |
| no animation at all | you open it hundreds of times |
import { GraphTable } from '@fractaldesign/machines-ui';
<GraphTable
title="TASTE, EXPLAINED"
headers={['Decision', 'Reason']}
rows={[
['ease-out on enter', 'feels snappier'],
['180ms, not 400ms', 'feels faster, more responsive'],
['springs for gestures', 'they carry your momentum'],
['scale 0.97 on press', 'it makes the UI feel alive'],
['no animation at all', 'you open it hundreds of times']
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words. |
| headers* | string[] | — | Column headers, left to right. |
| rows* | Cell[][] | — | Body rows; each cell is a string, number, or snippet. |
| footer | Cell[] | — | Optional totals row, one cell per column. |
| align | ('left' | 'right')[] | — | Per-column alignment; defaults to left for the first column and right for the rest. |
| corner | string | — | Character drawn at each corner of the frame. |
| class | string | '' |
API
- class forwarded to the outer element
- motion reveals on scroll into view
Types
| Name | Kind | Description |
|---|---|---|
| Cell | type | Framed data table with an optional footer row for totals. Snippet | string | number |
Related
Built from
src/lib/components/graphs/GraphTable.svelte