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

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text, the sample record and the date and money formats.
recordobject—The record to show (see usage for its fields).
activityArray<{ id, kind, who, text, when }>—The timeline, newest first. An empty list says so and invites the first comment.
statusesArray<{ 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).
currencystringby localeISO currency of the budget, for example EUR (or `record.currency`).
factsArray<{ label, value }>client, owner, start, due, budget, billingThe rows of the Overview tab, in place of the built-in project facts. The copyable id stays last.
filesArray<{ name, meta }>sample filesThe Files tab.
peopleArray<{ name, role, tone?: 0 | 1 | 2 | 3 }>sample peopleThe People card beside the tabs; initials are drawn from the name.
next{ name, date: 'YYYY-MM-DD' } | nullsample milestoneThe next milestone card; null hides it.
defaultTab'overview' | 'activity' | 'files''overview'The tab shown first.
loading / errorboolean—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.
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.

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.