Workbench comes with Pro. Its preview shows once you unlock it.
Usage
import { Workbench } from './Workbench.jsx'
<Workbench
locale="en"
name={user.firstName}
hour={new Date().getHours()}
todos={tasks.list} // [{ id, title, when?, late?, done? }]
shortcuts={[{ label: 'New roast', icon: 'plus' }, { label: 'Log a brew', icon: 'cup' }]}
agenda={[{ time: '10:00', title: 'Cupping session', where: 'Lab · 45 min' }]}
numbers={[{ label: 'Bags sold', value: '312', change: '8%', trend: 'up' }]}
recent={[{ kind: 'roast', icon: 'cup', title: 'Ethiopia Guji', meta: 'Roast · 10 min ago', href: '/roasts/guji' }]}
loading={tasks.loading}
error={tasks.error}
onRetry={tasks.reload}
onToggle={(id, done) => tasks.update(id, { done })}
onShortcut={(index) => router.push(['/projects/new', '/invoices/new', '/time', '/files'][index])}
onOpen={(item) => router.push(item.href)}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text and sample data. |
name / hour | string / number | 'Mia' / 9 | Who is greeted, and the hour that picks morning, afternoon or evening (pass it so server and browser agree). |
todos | Array<{ id, title, when?, late?, done? }> | — | The to-dos. With none open, the module says all is clear and where new ones come from. |
date | string | by locale | The date line above the greeting, already formatted. |
shortcuts | Array<string | { label, icon? }> | 4 sample shortcuts | The shortcut buttons; `onShortcut` gets the index. Icons are kit icon names. |
agenda | Array<{ time, title, where }> | sample agenda | Today’s agenda card. |
numbers | Array<{ label, value, change, trend: 'up' | 'down' }> | sample numbers | The week’s numbers; values are shown as given. |
recent | Array<{ kind, title, meta, icon? }> | sample records | Recently opened records; `onOpen` gets the item. |
loading / error | boolean | — | Placeholder modules while loading; a message and a retry (onRetry) when the day could not be loaded. |
onToggle / onShortcut / onOpen | (id, done) => void / (index) => void / (item) => void | — | A to-do was ticked or unticked; a shortcut was pressed; a recent item was opened. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
Add it to your project
Pro includes the full source of this block. Copy its prompt to install it with your coding agent.
Workbench.jsxworkbench.csscopy.jskit.jsxkit.cssui/base-button/ui/alert-banner/ui/checkbox/ui/skeleton-shimmer/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
