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
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>}
/>On iOS & Android
This template has no native twin yet. On mobile, compose it from the @nexub/react-native components listed on the React Native page.