Usage
import { DashboardTable } from './DashboardTable.jsx'
// Without rows the table shows its sample bakery orders. Your own records, statuses and moves:
<DashboardTable
locale="en"
rows={brews.list} // [{ id, number, name, items: [string | { qty, name }], time, status, total }]
statuses={[
{ id: 'resting', label: 'Resting', tone: 'progress', pulse: true },
{ id: 'tasted', label: 'Tasted', tone: 'success', icon: 'check' },
{ id: 'binned', label: 'Binned', tone: 'danger', void: true },
]}
actions={[{ id: 'taste', label: 'Mark tasted', from: 'resting', to: 'tasted', icon: 'check' }]}
columns={{ order: 'Brew', items: 'Recipe', time: 'Brewed', total: 'Score' }}
format="number"
labels={{ title: 'Brews this week', search: 'Search brews', searchPlaceholder: 'Bean, number or method' }}
loading={brews.loading}
error={brews.error}
onRetry={brews.reload}
onStatusChange={async (ids, status) => await brews.move(ids, status)}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text, the sample orders and the time and money formats. |
rows | Array<{ id, number, name, items: Array<string | { qty, name }>, time, status, total }> | sample orders | The records. `time` is minutes after midnight or your own text; `status` is the id of one of `statuses`. `customer` and `pickup` are the older names of `name` and `time`. A new array replaces the table. |
statuses | Array<{ id, label, tone: 'progress' | 'success' | 'warning' | 'danger' | 'neutral', pulse?, icon?, void? }> | baking, ready, collected, cancelled | The statuses in tab order. `pulse` makes the tag breathe, `icon` is a kit icon, `void` greys the total and keeps the row from being picked. |
actions | Array<{ id, label, from: string | string[], to, icon? }> | Mark ready, Mark collected | The buttons of the selection bar. Each moves the picked rows whose status is in `from` to `to`; the first one is the primary button. An empty array leaves the bar without buttons. |
columns | { order?, items?, time?, status?, total?: string | false } | Array<{ key, title, render(row), align? }> | — | An object renames the built-in columns (false hides items, time or total); an array replaces them with your own. |
format | 'currency' | 'number' | 'percent' | 'duration' | (value) => string | 'currency' | How the total column reads: money in `currency`, a plain number, a percent, a duration in seconds, or your function. |
currency | string | by locale | ISO currency code of the totals. |
onStatusChange | (ids, status) => Promise<void | false> | — | Moves the selected rows on with one of `actions` (in the sample: baking to ready, ready to collected). Resolve false to keep them as they were. |
loading | boolean | false | Shows the skeleton of the table. |
error / onRetry | boolean | string / () => void | false | Shows the error banner with a retry button; a string replaces its sentence. |
labels | object | — | Replaces any built-in text (keys as in copy.js), including the status names. |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
DashboardTable.jsxdashboard-table.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/status-tag/ui/alert-banner/ui/text-input/ui/skeleton-shimmer/ui/sliding-tabs/ui/select-table/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.