Skip to content
English
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

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and sample data.
name / hourstring / number'Mia' / 9Who is greeted, and the hour that picks morning, afternoon or evening (pass it so server and browser agree).
todosArray<{ id, title, when?, late?, done? }>—The to-dos. With none open, the module says all is clear and where new ones come from.
datestringby localeThe date line above the greeting, already formatted.
shortcutsArray<string | { label, icon? }>4 sample shortcutsThe shortcut buttons; `onShortcut` gets the index. Icons are kit icon names.
agendaArray<{ time, title, where }>sample agendaToday’s agenda card.
numbersArray<{ label, value, change, trend: 'up' | 'down' }>sample numbersThe week’s numbers; values are shown as given.
recentArray<{ kind, title, meta, icon? }>sample recordsRecently opened records; `onOpen` gets the item.
loading / errorboolean—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.
labelsobject—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.