Skip to content
nexubDesign System
v11.9.0

Patterns · Pages

Detail page

DetailPage

One record with view and edit modes: sections of labelled values that become a form in place, a sticky Save and Cancel bar, an unsaved-changes guard, and an aside for activity or progress.

Web

Live, at a real viewport width. Switch to Phone to see the responsive layout.

Usage

TSX
import { DetailPage } from '@nexub/patterns';

<DetailPage
  title="Ada Park"
  subtitle="Customer since March 2024"
  status={<Badge tone="success">Active</Badge>}
  backHref="/customers"
  sections={[
    {
      id: 'contact',
      title: 'Contact',
      fields: [
        { name: 'name', label: 'Name', value: customer.name, input: <Input defaultValue={customer.name} required /> },
        { name: 'email', label: 'Email', value: customer.email, input: <Input type="email" defaultValue={customer.email} />, span: 2 },
      ],
    },
  ]}
  onSave={(data) => save(Object.fromEntries(data))}
  aside={<ActivityFeed.Root>…</ActivityFeed.Root>}
/>