# Board

> A complete screen built from AppShell, AvatarStack, Badge, Button and 6 more components.

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

## Code

```tsx
import * as React from "react";
import {
  AppShell,
  AvatarStack,
  Badge,
  Button,
  Card,
  KanbanColumn,
  PageHeader,
  Progress,
  Tabs,
} from "@twentyfirstmedia/pro";
import type { Tint } from "@twentyfirstmedia/pro";

interface TaskProps {
  t: string;
  m?: string[];
  b?: React.ReactNode;
  who: string[];
  tint?: Tint;
  p?: number;
}

function T(p: TaskProps) {
  return (
    <Card
      onClick={() => {}}
      tint={p.tint}
      title={p.t}
      meta={p.m}
      status={p.b}
      actions={[<AvatarStack key={1} names={p.who} size={24} />]}
    >
      {p.p != null && <Progress value={p.p} tint="mint" label="Progress" />}
    </Card>
  );
}
function App() {
  return (
    <AppShell
      brand="Halo"
      tag="Admin"
      user={{ name: "Mara Ellis", email: "mara@halo.app" }}
      active="Projects"
      dock={false}
    >
      <div className="tf-in">
        <PageHeader
          crumbs={["Projects", "Pricing page refresh"]}
          title="Sprint 14 board"
          subtitle="18 tasks · ends Friday"
          actions={[
            <AvatarStack
              key="a"
              names={[
                "Mara Ellis",
                "Jonah Petit",
                "Sun Lee",
                "Rui Costa",
                "Ida Nolan",
                "Ava Brandt",
              ]}
            />,
            <Tabs key="t" items={["Board", "List", "Timeline"]} />,
            <Button key="n" icon="plus">
              New task
            </Button>,
          ]}
        />
      </div>
      <div
        className="tf-grid"
        style={
          {
            "--cols": "repeat(4, 1fr)",
            "--cols-sm": "repeat(4, minmax(260px, 85%))",
            "--cols-md": "repeat(2, minmax(0, 1fr))",
            gap: 16,
            alignItems: "start",
            overflowX: "auto",
          } as React.CSSProperties
        }
      >
        <KanbanColumn title="To do" dot="sky" delay={120}>
          <T
            t="Write FAQ for annual plans"
            m={["Docs", "Due Thu"]}
            b={<Badge>Copy</Badge>}
            who={["Ava Brandt"]}
          />
          <T
            t="Localise tiers for DE and FR"
            m={["Growth"]}
            b={<Badge tone="info">i18n</Badge>}
            who={["Sun Lee", "Ida Nolan"]}
          />
          <T
            t="Plan migration emails"
            m={["Lifecycle"]}
            b={<Badge>Email</Badge>}
            who={["Rui Costa"]}
          />
        </KanbanColumn>
        <KanbanColumn title="In progress" dot="butter" delay={220}>
          <T
            tint="lilac"
            t="Comparison table component"
            m={["Design system", "3 of 5 states"]}
            b={<Badge tone="highlight">Focus</Badge>}
            who={["Jonah Petit", "Mara Ellis"]}
            p={60}
          />
          <T
            t="Checkout seat selector"
            m={["Billing"]}
            b={<Badge tone="warning">Blocked</Badge>}
            who={["Rui Costa"]}
            p={30}
          />
        </KanbanColumn>
        <KanbanColumn title="In review" dot="lilac" delay={320}>
          <T
            t="Billing settings flow"
            m={["Due Fri"]}
            b={<Badge tone="highlight">Review</Badge>}
            who={["Mara Ellis", "Sun Lee"]}
          />
          <T
            t="Empty states for reports"
            m={["Due Mon"]}
            b={<Badge tone="warning">Changes</Badge>}
            who={["Jonah Petit"]}
          />
        </KanbanColumn>
        <KanbanColumn title="Done" dot="mint" delay={420}>
          <T
            t="Pricing research recap"
            m={["Shipped Tue"]}
            b={<Badge tone="success">Done</Badge>}
            who={["Sun Lee"]}
          />
          <T
            t="New tier names"
            m={["Shipped Mon"]}
            b={<Badge tone="success">Done</Badge>}
            who={["Mara Ellis"]}
          />
          <T
            t="Analytics events for upgrade"
            m={["Shipped Mon"]}
            b={<Badge tone="success">Done</Badge>}
            who={["Ida Nolan"]}
          />
        </KanbanColumn>
      </div>
    </AppShell>
  );
}
export default function Preview() {
  return <App />;
}
```

## 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). |
| `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[]` |  |
| `navigation?` | `"top" \| "sidebar"` | `top` (default): navigation in the top bar, tools in the side rail. `sidebar`: a labelled sidebar on the frame, with groups, nesting and a drawer on phones. |
| `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). |
| `children?` | `ReactNode` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### AvatarStack

| Prop | Type | Notes |
| --- | --- | --- |
| `names` | `string[]` | Required |
| `max?` | `number` |  |
| `size?` | `number` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Badge

| Prop | Type | Notes |
| --- | --- | --- |
| `tone?` | `Tone` |  |
| `dot?` | `boolean` |  |
| `live?` | `boolean` |  |
| `children?` | `ReactNode` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Button

| Prop | Type | Notes |
| --- | --- | --- |
| `variant?` | `"primary" \| "secondary" \| "soft" \| "ghost" \| "danger" \| "danger-solid"` |  |
| `size?` | `"md" \| "sm"` |  |
| `icon?` | `IconName` |  |
| `iconRight?` | `IconName` |  |
| `disabled?` | `boolean` |  |
| `type?` | `"button" \| "submit" \| "reset"` |  |
| `onClick?` | `(e: MouseEvent<HTMLButtonElement>) => void` |  |
| `children?` | `ReactNode` |  |
| `asChild?` | `boolean` | Render the single child element (a link, a router Link) with the button's look instead of a <button>. |
| `id?` | `string` |  |
| `name?` | `string` | Form field name and value, sent with the form when this button submits it. |
| `value?` | `string` |  |
| `form?` | `string` | The id of the form this button belongs to, when it sits outside it. |
| `title?` | `string` |  |
| `tabIndex?` | `number` |  |
| `autoFocus?` | `boolean` |  |
| `aria-label?` | `string` |  |
| `aria-labelledby?` | `string` |  |
| `aria-describedby?` | `string` |  |
| `aria-expanded?` | `boolean \| "true" \| "false"` | For disclosure and menu triggers: whether what the button controls is open. |
| `aria-controls?` | `string` |  |
| `aria-haspopup?` | `boolean \| "true" \| "false" \| "menu" \| "listbox" \| "tree" \| "grid" \| "dialog"` |  |
| `aria-pressed?` | `boolean \| "true" \| "false" \| "mixed"` | For toggle buttons. |
| `aria-current?` | `boolean \| "true" \| "false" \| "page" \| "step" \| "location" \| "date" \| "time"` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Card

| Prop | Type | Notes |
| --- | --- | --- |
| `title?` | `string` |  |
| `description?` | `string` |  |
| `meta?` | `string[]` |  |
| `corner?` | `ReactNode` |  |
| `status?` | `ReactNode` |  |
| `actions?` | `ReactNode[]` |  |
| `tint?` | `Tint \| "surface"` |  |
| `onClick?` | `() => void` |  |
| `children?` | `ReactNode` |  |
| `eyebrow?` | `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. |

### IconButton

| Prop | Type | Notes |
| --- | --- | --- |
| `icon` | `IconName` | Required |
| `label` | `string` | Accessible name and tooltip (`aria-label` and `title`); `aria-label` or `title` override them. |
| `variant?` | `"soft" \| "solid" \| "outline" \| "ghost"` |  |
| `size?` | `"sm" \| "md" \| "lg"` |  |
| `type?` | `"button" \| "submit" \| "reset"` |  |
| `onClick?` | `(e: MouseEvent<HTMLButtonElement>) => void` |  |
| `disabled?` | `boolean` |  |
| `asChild?` | `boolean` | Render the single child element (a link) with the button's look; the icon is placed inside it. |
| `children?` | `ReactNode` |  |
| `id?` | `string` |  |
| `name?` | `string` | Form field name and value, sent with the form when this button submits it. |
| `value?` | `string` |  |
| `form?` | `string` | The id of the form this button belongs to, when it sits outside it. |
| `title?` | `string` |  |
| `tabIndex?` | `number` |  |
| `autoFocus?` | `boolean` |  |
| `aria-label?` | `string` |  |
| `aria-labelledby?` | `string` |  |
| `aria-describedby?` | `string` |  |
| `aria-expanded?` | `boolean \| "true" \| "false"` | For disclosure and menu triggers: whether what the button controls is open. |
| `aria-controls?` | `string` |  |
| `aria-haspopup?` | `boolean \| "true" \| "false" \| "menu" \| "listbox" \| "tree" \| "grid" \| "dialog"` |  |
| `aria-pressed?` | `boolean \| "true" \| "false" \| "mixed"` | For toggle buttons. |
| `aria-current?` | `boolean \| "true" \| "false" \| "page" \| "step" \| "location" \| "date" \| "time"` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### KanbanColumn

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `string` | Required |
| `dot?` | `Tint` |  |
| `delay?` | `number` |  |
| `children?` | `ReactNode` |  |
| `onAdd?` | `() => void` |  |
| `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. |

### Progress

| Prop | Type | Notes |
| --- | --- | --- |
| `value` | `number` | Required |
| `tint?` | `"sky" \| "mint" \| "butter"` |  |
| `label?` | `string` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Tabs

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `string[]` | Required |
| `value?` | `string` |  |
| `defaultValue?` | `string` |  |
| `onChange?` | `(v: string) => void` |  |
| `block?` | `boolean` |  |
| `panels?` | `Record<string, ReactNode>` | Content per tab; renders the tab panels under the bar, wired with tab/tabpanel roles. |
| `label?` | `string` | Accessible name of the tab list. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
