# Golf

> Golf from the club system, a round tracker and a launch monitor: handicap and season numbers, the last round as a scorecard, the round as a workout and carry by club from the range.

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

Golf from the club system, a round tracker and a launch monitor: handicap and season numbers, the
last round as a scorecard, the round as a workout and carry by club from the range.

## Code

```tsx
import * as React from "react";
import {
  AppShell,
  BarList,
  PageHeader,
  Panel,
  Scorecard,
  Stagger,
  StatTile,
  WorkoutCard,
} from "@twentyfirstmedia/pro";
import "./_connectors";
import { LIFE_NAV } from "./_lifenav";

const PAR = [4, 4, 3, 5, 4, 4, 3, 4, 5, 4, 3, 4, 5, 4, 4, 3, 4, 5];
const STROKES = [5, 4, 3, 6, 4, 5, 2, 4, 5, 6, 3, 4, 4, 5, 4, 4, 5, 6];
const PUTTS = [2, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 2];

/** Golf: handicap from the club, the last round as a scorecard, the round as a workout and range carry by club. */
export default function Preview() {
  return (
    <AppShell
      navigation="sidebar"
      brand="Life"
      sidebarGroups={LIFE_NAV}
      active="golf"
      user={{ name: "Mara Ellis", email: "mara@halo.app" }}
      dock={false}
    >
      <div className="tf-in">
        <PageHeader title="Golf" subtitle="From PCCADDIE, Hole19 and Trackman" />
      </div>
      <Stagger className="tf-col" style={{ gap: 16 }}>
        <div
          className="tf-grid"
          style={
            {
              "--cols": "repeat(3, minmax(0, 1fr))",
              "--cols-sm": "1fr",
              gap: 16,
            } as React.CSSProperties
          }
        >
          <StatTile label="Handicap index" value="18.4" delta="−0.6" tint="mint" />
          <StatTile label="Rounds this year" value="23" tint="sky" />
          <StatTile label="Putts per round" value="34.1" delta="−1.2" tint="butter" />
        </div>
        <Scorecard
          course="GC Hamburg-Walddörfer"
          date={new Date(2026, 10, 13)}
          tee="Yellow · CR 71.2 / SR 128"
          service={{ name: "Hole19", icon: "brandHole19" }}
          holes={PAR.map((par, i) => ({ par, strokes: STROKES[i], putts: PUTTS[i] }))}
        />
        <div
          className="tf-grid"
          style={
            {
              "--cols": "minmax(0, 1fr) minmax(0, 1fr)",
              "--cols-sm": "1fr",
              gap: 16,
            } as React.CSSProperties
          }
        >
          <WorkoutCard
            type="Golf · 18 holes"
            icon="flag"
            date={new Date(2026, 10, 13, 10, 0)}
            duration={252}
            distance={9.6}
            calories={1140}
            heartRate={98}
            zones={[120, 96, 30, 6, 0]}
          />
          <Panel title="Range session" subtitle="Carry by club · Trackman, 12 November">
            <BarList
              items={[
                { label: "Driver", value: 212 },
                { label: "5 wood", value: 184 },
                { label: "7 iron", value: 142 },
                { label: "9 iron", value: 118 },
                { label: "Wedge", value: 92 },
              ]}
            />
          </Panel>
        </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. |

### BarList

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `{ id?: string; label: ReactNode; mark?: ReactNode; value: number; share?: number; tint?: Tint; }[]` | Required |
| `format?` | `(v: number) => string` |  |
| `onPick?` | `(item: NonNullable<BarListProps["items"]>[number]) => void` |  |
| `label?` | `string` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### PageHeader

| Prop | Type | Notes |
| --- | --- | --- |
| `crumbs?` | `(string \| Crumb)[]` | A breadcrumb above the title (see `Breadcrumb`): labels, or items with `href`/`onClick`. |
| `crumbLinkAs?` | `ElementType` | The element crumb links render as, e.g. Next.js `Link`. |
| `title` | `string` | Required |
| `subtitle?` | `string` |  |
| `actions?` | `ReactNode[]` |  |
| `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. |

### Scorecard

| Prop | Type | Notes |
| --- | --- | --- |
| `course` | `string` | Required |
| `date?` | `Date \| string \| number` |  |
| `holes` | `GolfHole[]` | 9 or 18 holes. |
| `tee?` | `string` | Tee and course rating: "Yellow · CR 71.2 / SR 128". |
| `service?` | `ServiceRef` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### StatTile

| Prop | Type | Notes |
| --- | --- | --- |
| `value` | `ReactNode` | Required |
| `label` | `string` | Required |
| `tint?` | `Tint \| "surface" \| "placeholder"` |  |
| `delta?` | `string` |  |
| `delay?` | `number` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### WorkoutCard

| Prop | Type | Notes |
| --- | --- | --- |
| `type` | `string` | "Run", "Ride", "Strength", "Golf" … |
| `icon?` | `IconName` |  |
| `date` | `Date \| string \| number` | Required |
| `duration` | `number` | Minutes. |
| `distance?` | `number` | Kilometres. |
| `calories?` | `number` |  |
| `heartRate?` | `number` | Average heart rate in bpm. |
| `zones?` | `number[]` | Minutes in heart-rate zones 1–5. |
| `service?` | `ServiceRef` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
