Detail page comes with Pro. Its preview shows once you unlock it.
Usage
import { DetailPage } from './DetailPage.jsx'
<DetailPage
locale="en"
record={project} // { id, name, status: 'draft' | 'active' | 'review' | 'approved', client, owner, start, due, budget, spent, billing, about }
activity={project.events} // [{ id, kind: 'status' | 'comment' | 'file' | 'invoice' | 'created', icon?, who, text, when }]
statuses={[ // optional: your own statuses; Approve moves the record to the final one
{ id: 'open', label: 'Open', tone: 'progress' },
{ id: 'done', label: 'Done', tone: 'success', final: true },
]}
facts={[{ label: 'Client', value: project.client }, { label: 'Due', value: '4 Dec' }]}
files={project.files} // [{ name, meta }]
people={project.people} // [{ name, role, tone: 0-3 }]
next={{ name: 'Menu boards to print', date: '2026-12-04' }}
currency="EUR"
loading={!project}
onAction={async (which) => { // 'approve' | 'edit' | 'share'
if (which === 'approve') return (await fetch('/api/projects/' + project.id + '/approve', { method: 'POST' })).ok
if (which === 'edit') router.push('/projects/' + project.id + '/edit')
}}
onComment={async (text) => (await postComment(project.id, text)).ok}
onBack={() => router.push('/projects')}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text, the sample record and the date and money formats. |
record | object | — | The record to show (see usage for its fields). |
activity | Array<{ id, kind, who, text, when }> | — | The timeline, newest first. An empty list says so and invites the first comment. |
statuses | Array<{ id, label, tone: 'neutral' | 'progress' | 'warning' | 'success' | 'danger', final? }> | 'draft, active, review, approved' | The statuses the record can have. A `final` one shows a check; Approve moves the record to the first final status and hides itself there (no final status: no Approve). |
currency | string | by locale | ISO currency of the budget, for example EUR (or `record.currency`). |
facts | Array<{ label, value }> | client, owner, start, due, budget, billing | The rows of the Overview tab, in place of the built-in project facts. The copyable id stays last. |
files | Array<{ name, meta }> | sample files | The Files tab. |
people | Array<{ name, role, tone?: 0 | 1 | 2 | 3 }> | sample people | The People card beside the tabs; initials are drawn from the name. |
next | { name, date: 'YYYY-MM-DD' } | null | sample milestone | The next milestone card; null hides it. |
defaultTab | 'overview' | 'activity' | 'files' | 'overview' | The tab shown first. |
loading / error | boolean | — | Placeholders while the record loads; a message and a retry when it could not be loaded (onRetry). |
onAction | (which: 'approve' | 'edit' | 'share', record) => Promise<boolean | void> | void | — | A header action was pressed. Resolve false when it did not work; approving then leaves the status as it was. |
onComment | (text) => Promise<boolean | void> | — | A comment was sent. |
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.
DetailPage.jsxdetail-page.csscopy.jskit.jsxkit.cssui/base-button/ui/copy-button/ui/status-tag/ui/alert-banner/ui/textarea/ui/skeleton-shimmer/ui/sliding-tabs/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
