# Contact

> A person in the CRM: header with email, call and meeting, the activity timeline with a composer, and beside it the editable details, open deals and tasks.

Pattern · Pro kit · [Live page](https://ui.twentyfirst.media/pro/patterns/ContactScreen/)

A person in the CRM: header with email, call and meeting, the activity timeline with a composer,
and beside it the editable details, open deals and tasks.

## Code

```tsx
import * as React from "react";
import {
  AppShell,
  DealCard,
  Panel,
  PropertyList,
  RecordHeader,
  RecordTimeline,
  Stagger,
  TaskList,
} from "@twentyfirstmedia/pro";
import type { PropertyField, RecordEntry } from "@twentyfirstmedia/pro";
import { CRM_NAV, ENTRIES, NOW } from "./_crm";

/** A person in the CRM: header with quick actions, the activity timeline, details, deals and tasks. */
export default function Preview() {
  const [entries, setEntries] = React.useState<RecordEntry[]>(ENTRIES);
  const [fields, setFields] = React.useState<PropertyField[]>([
    { id: "email", label: "Email", type: "email", value: "lena@nordhafen.de" },
    { id: "phone", label: "Phone", type: "phone", value: "+49 40 2287 1190" },
    { id: "company", label: "Company", value: "Nordhafen Outdoor" },
    {
      id: "stage",
      label: "Lifecycle",
      type: "select",
      value: "Customer",
      options: ["Lead", "Prospect", "Customer"],
    },
    { id: "owner", label: "Owner", type: "person", value: "Mara Ellis" },
    { id: "birthday", label: "Birthday", type: "date", value: new Date(1986, 4, 12) },
    { id: "tags", label: "Tags", type: "tags", value: ["Decision maker", "Hamburg"] },
  ]);
  return (
    <AppShell
      navigation="sidebar"
      brand="Pilot CRM"
      sidebarGroups={CRM_NAV}
      active="people"
      user={{ name: "Mara Ellis", email: "mara@pilot.app" }}
      dock={false}
    >
      <Stagger className="tf-col" style={{ gap: 16 }}>
        <RecordHeader
          title="Lena Hartmann"
          subtitle="Head of Operations at Nordhafen Outdoor"
          status={{ label: "Customer", tone: "success" }}
          tags={["Decision maker"]}
          owner="Mara Ellis"
          actions={[
            { label: "Email", icon: "mail", primary: true },
            { label: "Call", icon: "phone" },
            { label: "Meeting", icon: "calendar" },
          ]}
          facts={[
            { label: "Open deals", value: "€78,000" },
            { label: "Won", value: "€126,400" },
            { label: "Last contact", value: "Today, 8:42 AM" },
          ]}
        />
        <div
          className="tf-grid"
          style={
            {
              "--cols": "minmax(0, 3fr) minmax(0, 2fr)",
              "--cols-sm": "1fr",
              gap: 16,
              alignItems: "start",
            } as React.CSSProperties
          }
        >
          <Panel title="Activity">
            <RecordTimeline
              entries={entries}
              now={NOW}
              onAdd={(type, text) =>
                setEntries((all) => [
                  { id: "n" + all.length, type, title: text, at: NOW, actor: "Mara Ellis" },
                  ...all,
                ])
              }
            />
          </Panel>
          <div className="tf-col" style={{ gap: 16 }}>
            <Panel title="Details">
              <PropertyList
                fields={fields}
                onChange={(id, v) =>
                  setFields((all) => all.map((f) => (f.id === id ? { ...f, value: v } : f)))
                }
              />
            </Panel>
            <Panel title="Deals" subtitle="2 open">
              <DealCard
                deal={{
                  id: "d6",
                  title: "Nordhafen renewal",
                  value: 36000,
                  probability: 80,
                  closeDate: new Date(2026, 10, 30),
                  daysInStage: 4,
                  next: "Contract to legal",
                }}
                onOpen={() => {}}
              />
              <DealCard
                deal={{
                  id: "d3",
                  title: "Shop migration",
                  value: 42000,
                  probability: 30,
                  closeDate: new Date(2026, 11, 12),
                  daysInStage: 6,
                }}
                onOpen={() => {}}
              />
            </Panel>
            <Panel title="Tasks">
              <TaskList
                grouped={false}
                today={NOW}
                onToggle={() => {}}
                tasks={[
                  {
                    id: "1",
                    title: "Call Lena about the contract",
                    due: NOW,
                    assignee: "Mara Ellis",
                  },
                  {
                    id: "2",
                    title: "Ask for two references",
                    due: new Date(2026, 10, 19),
                    priority: "low",
                  },
                ]}
              />
            </Panel>
          </div>
        </div>
      </Stagger>
    </AppShell>
  );
}
```

## Props

### AppShell

| Prop | Type | Notes |
| --- | --- | --- |
| `active?` | `string` |  |
| `brand?` | `ReactNode` | The product name, or a node (a logo mark with the name; collapsed sidebars show it whole). |
| `brandDot?` | `boolean` | The status dot after the brand (default `true`); turn it off next to a logo of your own. |
| `tag?` | `string` |  |
| `nav?` | `NavItem[]` |  |
| `user?` | `{ name: string; email?: string }` |  |
| `onNavigate?` | `(label: string) => void` |  |
| `topExtra?` | `ReactNode` |  |
| `sheetStyle?` | `CSSProperties` |  |
| `contentKey?` | `string \| number` |  |
| `side?` | `ReactNode` |  |
| `dock?` | `boolean` |  |
| `dockItems?` | `DockProps["items"]` |  |
| `railTop?` | `RailItem[]` |  |
| `railBottom?` | `RailItem[]` |  |
| `fill?` | `boolean` | The shell is the whole page: at least the viewport's height (100dvh), no outer radius, the sheet fills the rest; on desktop the sidebar stays in view while the page scrolls, on phones the sheet starts right under the sidebar's bar. |
| `navigation?` | `"top" \| "sidebar"` |  |
| `sidebarGroups?` | `SidebarGroup[]` | With `navigation="sidebar"`: groups instead of the flat `nav` list. |
| `sidebar?` | `Partial<Omit<SidebarProps, "variant" \| "groups">>` | With `navigation="sidebar"`: more sidebar props (collapsed, storageKey, shortcut, linkAs …). |
| `workspaces?` | `WorkspaceSwitcherProps` | With `navigation="sidebar"`: the workspace switcher at the top instead of the brand. |
| `userMenu?` | `(MenuItem \| "-")[]` | The account menu's entries (with `navigation="sidebar"` at the foot of the sidebar). |
| `topbar?` | `boolean \| ReactNode` | With `navigation="sidebar"`: a bar across the top of the frame. The brand (or `workspaces`) moves into its start, as wide as the sidebar below it (expanded or collapsed); `topStart` follows it, `topEnd` sits at the end. Frame, bar and sidebar read as one L around the sheet. Content given here goes between `topStart` and `topEnd`. On phones the bar is the sidebar's bar (menu button and brand) with `topEnd` on the right and `topStart` behind an icon button. |
| `topStart?` | `ReactNode` | With `topbar`: right after the brand, e.g. a search field or a command palette trigger. |
| `topEnd?` | `ReactNode` | With `topbar`: at the end of the bar (buttons, menus); `topExtra` goes there too. |
| `topStartCompact?` | `ReactNode` | With `topbar` on phones: what stands in for `topStart` (default: an icon button that opens `topStart` over the bar). |
| `topStartIcon?` | `IconName` | The icon of that button (default `search`). |
| `topStartLabel?` | `string` | The accessible name of that button (default "Search"). |
| `children?` | `ReactNode` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### DealCard

| Prop | Type | Notes |
| --- | --- | --- |
| `deal` | `Deal` | Required |
| `staleAfter?` | `number` | Days in stage after which the deal is marked as stale (default 14). |
| `onOpen?` | `(id: string) => void` |  |
| `stages?` | `{ id: string; label: string }[]` | Stages offered in the card's "Move to" menu. |
| `onMove?` | `(id: string, stageId: string) => void` |  |
| `surface?` | `Surface` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Panel

| Prop | Type | Notes |
| --- | --- | --- |
| `side?` | `boolean` |  |
| `title?` | `string` |  |
| `subtitle?` | `string` |  |
| `action?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `surface?` | `Surface` | `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### PropertyList

| Prop | Type | Notes |
| --- | --- | --- |
| `fields` | `PropertyField[]` | Required |
| `onChange?` | `(id: string, value: string) => void` | Makes every field that is not `readOnly` editable in place. Values arrive as strings (tags comma-separated). |
| `label?` | `string` | Accessible name (default "Details"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### RecordHeader

| Prop | Type | Notes |
| --- | --- | --- |
| `kind?` | `"person" \| "company" \| "deal" \| "matter"` | Sets the default picture: a person's initials, a company's monogram, a deal or matter icon. |
| `title` | `string` | Required |
| `subtitle?` | `ReactNode` | "Head of Operations at Nordhafen", "Matter 2026/0412". |
| `avatar?` | `ReactNode` | Your own picture (a photo, a logo); default from `kind`. |
| `icon?` | `IconName` |  |
| `status?` | `{ label: string; tone?: Tone }` | The stage or status as a badge. |
| `tags?` | `string[]` |  |
| `owner?` | `string` | Who looks after the record. |
| `facts?` | `{ label: string; value: ReactNode }[]` | Key facts in a row: value, phone, close date … |
| `actions?` | `{ label: string; icon?: IconName; onClick?: () => void; primary?: boolean }[]` | Quick actions: Call, Email, Meeting, Note … The first `primary` one is the main button. |
| `menu?` | `ReactNode` | More actions on the right (a menu button). |
| `surface?` | `Surface` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### RecordTimeline

| Prop | Type | Notes |
| --- | --- | --- |
| `entries` | `RecordEntry[]` | Required |
| `now?` | `Date \| string \| number` | "Now" for the day headings; pass it so server and client render the same. |
| `filters?` | `boolean` | Chips that filter by type (default true). |
| `onAdd?` | `(type: "note" \| "call" \| "task", text: string) => void` | Adds the composer for a note, a logged call or a task. |
| `label?` | `string` | Accessible name (default "Activity"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### TaskList

| Prop | Type | Notes |
| --- | --- | --- |
| `tasks` | `CrmTask[]` | Required |
| `today?` | `Date \| string \| number` | The day that counts as today; pass it so server and client render the same. |
| `onToggle?` | `(id: string, done: boolean) => void` |  |
| `onOpen?` | `(id: string) => void` |  |
| `grouped?` | `boolean` | Groups: overdue, today, upcoming, no date, done (default true). |
| `label?` | `string` | Accessible name (default "Tasks"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
