# Agency Project

> An agency project: the plan as a Gantt chart with milestones, budget by phase, the running timer and this week's timesheet.

Pattern · Halo kit · [Live page](https://ui.twentyfirst.media/halo/patterns/AgencyProjectScreen/)

An agency project: the plan as a Gantt chart with milestones, budget by phase, the running timer
and this week's timesheet.

## Code

```tsx
import * as React from "react";
import {
  AppShell,
  BudgetList,
  Gantt,
  Panel,
  RecordHeader,
  Stagger,
  TimeTracker,
  Timesheet,
} from "@twentyfirstmedia/halo";
import { AGENCY_NAV } from "./_crm";
import { PLAN, WEEK } from "./_sales";

const NOW = new Date(2026, 10, 16, 11, 12);

/** An agency project: the plan as a timeline, budget per phase, this week's hours and the timer. */
export default function Preview() {
  const [rows, setRows] = React.useState(WEEK);
  const [running, setRunning] = React.useState(true);
  return (
    <AppShell
      navigation="sidebar"
      brand="Studio Hafen"
      sidebarGroups={AGENCY_NAV}
      active="projects"
      user={{ name: "Mara Ellis", email: "mara@studiohafen.de" }}
      dock={false}
    >
      <Stagger className="tf-col" style={{ gap: 16 }}>
        <RecordHeader
          kind="deal"
          icon="folder"
          title="Website relaunch"
          subtitle="Nordhafen Outdoor · Fixed price with hourly extras"
          status={{ label: "On track", tone: "success" }}
          owner="Mara Ellis"
          actions={[
            { label: "Log time", icon: "clock", primary: true },
            { label: "Invoice", icon: "card" },
          ]}
          facts={[
            { label: "Budget", value: "€41,700" },
            { label: "Used", value: "62%" },
            { label: "Hours", value: "284 of 420" },
            { label: "Launch", value: "Dec 14" },
          ]}
        />
        <Panel title="Plan">
          <Gantt tasks={PLAN} today={NOW} onOpen={() => {}} />
        </Panel>
        <div
          className="tf-grid"
          style={
            {
              "--cols": "minmax(0, 1fr) minmax(0, 1fr)",
              "--cols-sm": "1fr",
              gap: 16,
              alignItems: "start",
            } as React.CSSProperties
          }
        >
          <Panel title="Budget by phase">
            <BudgetList
              categories={[
                {
                  id: "d",
                  label: "Discovery",
                  icon: "sparkle",
                  tint: "lilac",
                  spent: 6400,
                  limit: 6400,
                },
                { id: "de", label: "Design", icon: "image", tint: "sky", spent: 6900, limit: 7680 },
                {
                  id: "dev",
                  label: "Development",
                  icon: "code",
                  tint: "mint",
                  spent: 12600,
                  limit: 14490,
                },
                {
                  id: "pm",
                  label: "Project management",
                  icon: "users",
                  tint: "butter",
                  spent: 3100,
                  limit: 2800,
                },
              ]}
            />
          </Panel>
          <Panel title="Timer">
            <TimeTracker
              running={running}
              startedAt={new Date(NOW.getTime() - 2537000)}
              now={NOW}
              task="Checkout flow: address step"
              project="Nordhafen · Website relaunch"
              projects={["Nordhafen · Website relaunch", "Velo Werk · App redesign", "Internal"]}
              onStart={() => setRunning(true)}
              onStop={() => setRunning(false)}
              entries={[
                {
                  id: "1",
                  project: "Nordhafen · Website relaunch",
                  task: "Stand-up and planning",
                  minutes: 30,
                  billable: true,
                },
                {
                  id: "2",
                  project: "Nordhafen · Website relaunch",
                  task: "Template review with Lena",
                  minutes: 60,
                  billable: true,
                },
              ]}
            />
          </Panel>
        </div>
        <Panel title="This week" subtitle="Week 47 · target 8 h a day">
          <Timesheet
            rows={rows}
            weekStart={new Date(2026, 10, 16)}
            target={8}
            onChange={(id, day, hours) =>
              setRows((all) =>
                all.map((r) =>
                  r.id === id ? { ...r, hours: r.hours.map((h, i) => (i === day ? hours : h)) } : r,
                ),
              )
            }
          />
        </Panel>
      </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. |

### BudgetList

| Prop | Type | Notes |
| --- | --- | --- |
| `categories` | `BudgetCategory[]` | Required |
| `currency?` | `string` |  |
| `onSelect?` | `(id: string) => void` | A category was picked (to show its transactions). |
| `label?` | `string` | Accessible name (default "Budgets"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Gantt

| Prop | Type | Notes |
| --- | --- | --- |
| `tasks` | `GanttTask[]` | Required |
| `from?` | `Date \| string \| number` | First and last day shown (default: the tasks' range). |
| `to?` | `Date \| string \| number` |  |
| `today?` | `Date \| string \| number` | Draws the today line. |
| `onOpen?` | `(id: string) => void` | Makes each task a button. |
| `label?` | `string` | Accessible name (default "Timeline"). |
| `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. |

### 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. |

### TimeTracker

| Prop | Type | Notes |
| --- | --- | --- |
| `running?` | `boolean` |  |
| `startedAt?` | `Date \| string \| number` |  |
| `now?` | `Date \| string \| number` | Fixed "now" for the timer; ticks every second when unset. |
| `task?` | `string` |  |
| `onTask?` | `(task: string) => void` |  |
| `project?` | `string` |  |
| `projects?` | `string[]` |  |
| `onProject?` | `(project: string) => void` |  |
| `billable?` | `boolean` |  |
| `onBillable?` | `(billable: boolean) => void` |  |
| `onStart?` | `() => void` |  |
| `onStop?` | `() => void` |  |
| `entries?` | `TimeEntry[]` | Today's entries under the timer, with their total. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Timesheet

| Prop | Type | Notes |
| --- | --- | --- |
| `rows` | `TimesheetRow[]` | Required |
| `weekStart` | `Date \| string \| number` | The Monday of the week. |
| `onChange?` | `(rowId: string, day: number, hours: number) => void` | Makes each cell an input. |
| `target?` | `number` | Hours a day should reach; day totals below it are marked. |
| `label?` | `string` | Accessible name (default "Timesheet"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
