# Surfaces

The page's ground, the cards that stand on it, the panes an app is built from and the frames set in their flow: what each holds, and what never goes inside what.

API [Card](/ui/storybook/?path=/docs/ui-primitives-card--docs) [Pane](/ui/storybook/?path=/docs/ui-primitives-pane--docs) [Frame](/ui/storybook/?path=/docs/ui-primitives-frame--docs) [LinkCard](/ui/storybook/?path=/docs/ui-primitives-linkcard--docs) [PreviewCard](/ui/storybook/?path=/docs/ui-primitives-previewcard--docs) [List](/ui/storybook/?path=/docs/ui-primitives-list--docs) [Table](/ui/storybook/?path=/docs/ui-primitives-table--docs) [Tabs](/ui/storybook/?path=/docs/ui-primitives-tabs--docs) [ContentFrame](/ui/storybook/?path=/docs/ui-content-contentframe--docs) [AttachmentList](/ui/storybook/?path=/docs/ui-content-attachmentlist--docs) [FenceFrame](/ui/storybook/?path=/docs/ui-code-fenceframe--docs) [Board](/ui/storybook/?path=/docs/ui-board--docs)

**Every box on screen is one of three things: a card standing on the page's ground, a frame set in the flow of a surface, or a row inside either. A card never stands on another card.** What fills a card is text, fields, rows, tiles and frames, so the ground shows between the cards and nowhere inside them.

```tsx
import { Badge } from "@orz/ui/components/badge";
import {
  Card,
  CardContent,
  CardHeader,
  CardTitle,
  ModuleGrid,
} from "@orz/ui/components/card";
import {
  LinkCard,
  LinkCardDescription,
  LinkCardTitle,
} from "@orz/ui/components/link-card";
import { List, ListItem } from "@orz/ui/components/list";
import { codeContent } from "@orz/ui-code";
import { ContentRenderers } from "@orz/ui-content";
import { Markdown } from "@orz/ui-markdown";
import { BookOpenIcon, RocketIcon } from "lucide-react";

const RENDERERS = [codeContent];

const CHECKS = [
  { name: "Unit tests", result: "Passed" },
  { name: "Migrations", result: "Passed" },
  { name: "Smoke test", result: "Passed" },
];

const NOTES = `Roll it back from the release's page, or by hand:

\`\`\`sh
deploy rollback api --to v2.48.0
\`\`\`
`;

const RUNBOOKS = [
  {
    href: "#rollback",
    title: "Roll back a release",
    description: "When the error rate climbs after a deploy.",
  },
  {
    href: "#drain",
    title: "Drain a region",
    description: "Before maintenance, or when a region is failing.",
  },
];

export function Layers() {
  return (
    <ModuleGrid className="md:grid-cols-[minmax(0,1fr)_15rem]">
      <Card>
        <CardHeader icon={<RocketIcon />}>
          <CardTitle>api v2.48.1</CardTitle>
        </CardHeader>
        <CardContent className="grid gap-3">
          <List purpose="collection">
            {CHECKS.map((check) => (
              <ListItem
                key={check.name}
                className="flex items-center justify-between gap-2 py-1.5"
              >
                {check.name}
                <Badge intent="success">{check.result}</Badge>
              </ListItem>
            ))}
          </List>
          <ContentRenderers renderers={RENDERERS}>
            <Markdown>{NOTES}</Markdown>
          </ContentRenderers>
        </CardContent>
      </Card>
      <Card>
        <CardHeader icon={<BookOpenIcon />}>
          <CardTitle>Runbooks</CardTitle>
        </CardHeader>
        <CardContent className="grid gap-2">
          {RUNBOOKS.map((runbook) => (
            <LinkCard
              key={runbook.href}
              href={runbook.href}
              variant="tile"
              size="sm"
            >
              <LinkCardTitle>{runbook.title}</LinkCardTitle>
              <LinkCardDescription>{runbook.description}</LinkCardDescription>
            </LinkCard>
          ))}
        </CardContent>
      </Card>
    </ModuleGrid>
  );
}
```

The release and its runbooks are two cards on the ground. The release's checks are rows of a list, and the command that rolls it back is a block of code in its frame. Each runbook is a link set inside a card, so it is a tile: a quiet fill with no edge of its own.

## The layers

| Layer          | What draws it                                                                                          | Stands on                                                        | Holds                                                                                                  |
| -------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Ground         | The page; an app's frame, between its panes (`Pane purpose="app"`)                                     | Nothing                                                          | Cards in a `ModuleGrid`, a `LinkCard`, a `PreviewCard`, an app's panes, a sidebar, a page's title line |
| Surface        | A `Card`; a pane the app draws as one; the sheet a page is read on; a `Dialog`, a `Sheet`, a `Popover` | The ground, or over the page for an overlay                      | A header, text, fields, rows, tiles and frames                                                         |
| Frame          | `Frame`, `ContentFrame`, `FenceFrame`, `Tabs variant="framed"`, `List framed`                          | A surface, in its flow                                           | A lid, a foot, and one block edge to edge between them                                                 |
| Rows and tiles | `List`, `Table`, `NavList`, `LinkCard` with `variant="row"` or `"tile"`                                | A surface or a frame; a sidebar's `NavList` stands on the ground | Text and controls, never a box                                                                         |
| Lane           | A `Board`'s `BoardColumn`, sunk to the ground's colour                                                 | A pane, which it cuts through                                    | `BoardCard`s, raised on it                                                                             |

## What goes inside what

| Inside                                                     | Put                                                                             | Never put                                               |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------- |
| The ground                                                 | `Card`, `LinkCard`, `PreviewCard`, an app's panes, a sidebar                    | A frame on its own, a tile                              |
| A card, a pane drawn as one, the reading sheet, an overlay | Text, fields, rows, tiles, frames                                               | A `Card`, a `LinkCard` drawn as a card, a `PreviewCard` |
| A frame                                                    | One block: code, a file, a diagram, a log, a set of tabs' panels, a list's rows | A card, a tile, another frame                           |
| A board's lane                                             | Its cards, each a `BoardCard`                                                   | A `Card`, a tile, a frame                               |

The one frame inside a frame is a document's own block: a Markdown file or a message shown in a frame keeps the frames of the code it holds, since they are its content.

## Cards stand on the ground

**A card is a module: it stands on the ground in a `ModuleGrid`, inside its own rule and over its own shadow.** What it holds is drawn on its face, so a card inside it would stand on white: two rules and two shadows where one edge was meant, and headers stacked with nothing to say which box each belongs to. What reads as parts of one module is parts of one card: the rows of a `List` or a `Table`, groups parted by space or a `Separator`, or cells ruled off inside it ([Layout & spacing](/ui/guidelines/foundations/layout-and-spacing/index.md#modules)).

**Do**

Set the parts of one module as rows inside its card.

**Don't**

Lay a card on a card. Its rule and its shadow double the edge it sits inside, and the eye has two boxes to tell apart where there was one thing to read.

A box that stands on its own on the ground, such as a column of links beside a page, is a card with a header. A frame's grey band is the lid of a block in a surface's flow; standing on the ground it reads as a block with its content missing.

**A list of files takes the look of where it stands.** Set among what a card or a pane holds, an `AttachmentList` is a frame, its rows under a lid. Standing on the ground beside the page's other modules, it is a card, `variant="card"`, and closed to its header line: the line names the files, so the reader sees what is there without the list pushing the page down, and the whole of it but the list's actions opens it. A link to the card's `id`, such as an **All 5 ↓** in a sidebar, opens it too. Start it open (`defaultOpen`) where the files are what the page is for, rather than what it is about.

```tsx
import { file } from "@orz/fixtures/files.ts";
import {
  Card,
  CardContent,
  CardHeader,
  CardTitle,
  ModuleGrid,
} from "@orz/ui/components/card";
import { ToolbarButton, ToolbarLabel } from "@orz/ui/components/toolbar";
import {
  type AttachmentItem,
  AttachmentList,
} from "@orz/ui-content/attachment";
import { DownloadIcon } from "lucide-react";

const FILES: AttachmentItem[] = [
  "paper.pdf",
  "gradient.png",
  "clip.webm",
  "tone.ogg",
  "bundle.zip",
].map((name, i) => ({
  ...file(name),
  key: name,
  createdAt: `2026-09-0${i + 1}T09:30:00Z`,
}));

export function FilesOnTheGround() {
  return (
    <ModuleGrid>
      <Card>
        <CardHeader>
          <CardTitle>Retry a fetch that times out</CardTitle>
        </CardHeader>
        <CardContent>
          The sync job gives up on the first timeout and waits an hour for the
          next run. Retry three times, a few seconds apart, before it gives up.
        </CardContent>
      </Card>
      <AttachmentList
        items={FILES}
        variant="card"
        listActions={() => (
          <ToolbarButton>
            <DownloadIcon />
            <ToolbarLabel>Download all</ToolbarLabel>
          </ToolbarButton>
        )}
      />
    </ModuleGrid>
  );
}
```

**A module whose title says how something stands, "Nightly backup failed" or "Replica db-2 is behind", takes the card's `intent`, drawn as a frame's is.** Its edge, header and footer take the status colour and its body a wash of it. A module whose title names a thing, with items of several statuses in it such as a table of runs, stays neutral and says each status with a `Badge` in its row. A merge box whose title is the verdict, as on [Color](/ui/guidelines/foundations/color/index.md), is the first kind, though it lists the checks behind the verdict. Keep the intent for what the reader should see now: a dashboard whose every card is tinted says nothing, and a check that has held for days needs no green.

## Panes

**An app's frame is `Pane purpose="app"`, and between its panes it is ground: from `md` up it lays them a module gap apart, each pane that is read or worked on drawn as a card, and the sidebar standing on the ground with no fill of its own.** A pane is a surface, then, and holds what a card holds. A region whose content is modules, a dashboard's or an admin screen's, is no pane: it is a `ModuleGrid` on the page's ground under the app's banner, as the Admin demo's sections are. On a phone the app is one sheet, the screen, and its panes are regions of it, ruled off where they meet.

A toolbar, a status bar and a titlebar are strips along a pane's edge rather than boxes: they take the pane's ground and a rule of their own ([Styles](/ui/guidelines/foundations/styles/index.md) names each `purpose`).

Tabs that switch everything a pane shows below its header, as a release's overview, log and diff do in the [Releases demo](/ui/demos/releases/index.md), are a strip of the pane too: `Tabs variant="pane"` runs the strip across the pane's row, its rule meeting the pane's sides, and the current panel fills the rest and scrolls on its own. Framed, the same set would be a box round the pane's whole content, its edge doubling the pane's and its gutter taken from every panel. A module on the ground whose tabs switch all it shows, the Admin demo's members and invitations, is a `Card` holding the same set: the strip is the card's head, the panel the rest of the card. A frame there would stand on the ground as a block with no surface round it.

## Frames sit in a surface's flow

**A box set among what a surface holds, a block of code, a file embedded in a document, a set of tabs that is one block among others, is a `Frame`.** Its heading line goes on its lid, a `FrameBar`; the actions that close it go on its foot, a `FrameBar side="bottom"`; what lies between runs edge to edge. Every block a document holds is one: a fenced block of code is a `FenceFrame`, an embedded file a `ContentFrame` ([Code blocks](/ui/guidelines/patterns/code-blocks/index.md), [Long content](/ui/guidelines/patterns/long-content/index.md)). A sample shown on its own, such as a preview of an editor's text, is a `Frame inset`, a quieter ground that does not stand off the page.

**A frame that waits on its reader, or says how something ended, takes an `intent`, and its lid says the status in words.** `warning` is for what wants the reader before it can go on: a question to answer, a change to look over. `danger` is a run or a step that failed, and `success` one that finished as it should. The frame's edge, lid and foot take the status colour, what it holds lies on a wash of it, and the words on its lid say what the colour means, for a reader who cannot tell the colours apart ([Color](/ui/guidelines/foundations/color/index.md#meaning)). A block the message shows, such as a failed run's log, keeps its own frame inside, as any message's blocks do, and stays as it is; so do the buttons on the foot: the action that answers is still the primary one.

```tsx
import { Button } from "@orz/ui/components/button";
import { ModuleMarker } from "@orz/ui/components/card";
import { Frame, FrameBar } from "@orz/ui/components/frame";
import { GroupHeading } from "@orz/ui/components/group-heading";
import { Label } from "@orz/ui/components/label";
import { RadioGroup, RadioGroupItem } from "@orz/ui/components/radio-group";
import {
  TITLE_KEEP_CHARS,
  ToolbarFocusable,
  ToolbarItem,
  ToolbarItemText,
  ToolbarSpacer,
} from "@orz/ui/components/toolbar";
import { MessageCircleQuestionMarkIcon } from "lucide-react";

const OPTIONS = [
  { value: "wait", label: "Wait for the migration" },
  { value: "now", label: "Ship now, on the old columns" },
];

export function AwaitingAnswer() {
  return (
    <Frame intent="warning" asChild>
      <form
        aria-labelledby="awaiting-answer-title"
        onSubmit={(event) => event.preventDefault()}
      >
        <FrameBar aria-labelledby="awaiting-answer-title">
          <ToolbarItem flex keepChars={TITLE_KEEP_CHARS} className="gap-2">
            <ModuleMarker icon={<MessageCircleQuestionMarkIcon />} />
            <ToolbarItemText>
              <span id="awaiting-answer-title" className="font-medium">
                Awaiting your answer
              </span>{" "}
              · 1 question
            </ToolbarItemText>
          </ToolbarItem>
        </FrameBar>
        <div className="grid gap-3 p-3 text-ui">
          <div className="grid gap-0.5">
            <GroupHeading>Release order</GroupHeading>
            <p id="awaiting-answer-question">
              Should the release wait for the migration to finish?
            </p>
          </div>
          <RadioGroup
            defaultValue="wait"
            aria-labelledby="awaiting-answer-question"
          >
            {OPTIONS.map(({ value, label }) => (
              <div key={value} className="flex items-center gap-2">
                <RadioGroupItem value={value} id={`awaiting-answer-${value}`} />
                <Label htmlFor={`awaiting-answer-${value}`}>{label}</Label>
              </div>
            ))}
          </RadioGroup>
        </div>
        <FrameBar side="bottom" aria-label="Answer">
          <ToolbarSpacer />
          <ToolbarItem>
            <ToolbarFocusable>
              <Button variant="ghost" size="sm">
                Skip unanswered…
              </Button>
            </ToolbarFocusable>
          </ToolbarItem>
          <ToolbarItem>
            <ToolbarFocusable>
              <Button type="submit" size="sm">
                Submit answers
              </Button>
            </ToolbarFocusable>
          </ToolbarItem>
        </FrameBar>
      </form>
    </Frame>
  );
}
```

Most frames have no intent: a block of code, a comment and a reply box say nothing about how anything stands. Nor does what has not ended, a run still going or waiting in a queue, or what someone ended by choice, a run they cancelled. In a history of runs only the one that stands now takes an intent, and the older ones say theirs with a `Badge`: a timeline of green frames hides the red one. Once the reader has answered or dealt with a frame, it goes back to having none, and its lid says who answered and when: an answer given is history, not a success. Write the status on the lid rather than set a `Badge` of the same colour on it, which only says it again.

Frames stand on the ground in one place: a contact sheet of live samples, such as the [Gallery](/ui/demos/gallery/index.md), where each cell is a sample under its name and shows its export as it is, a card as a card.

## Links to other places

**A `LinkCard` takes the look of where it stands.** On the ground it is a card, `variant="card"`, that lifts under the pointer: the page before and after this one. Inside a surface it is a tile, `variant="tile"`: a quiet fill with no edge or shadow, its title underlined under the pointer. In a list of pages it is a row, `variant="row"`. `size="sm"` sets it in an app's UI text rather than the prose of a page that is read, and `aria-current="true"` marks the one whose place is open beside it.

**Do**

Inside a card, draw each link as a tile.

**Don't**

Lay link cards inside a card. Each stands on the card's face as if on the ground: a box in a box.

**Where what the place looks like is what there is to say, as on the [Demos](/ui/demos/index.md) wall, the link is a `PreviewCard`.** Its `PreviewCardPicture` is a card on the ground holding a picture of the place at the picture's own proportions, and the name, a label and one line stand under it on the ground, the name a link that covers the whole card. A place told by its name and a sentence is a `LinkCard`: a wall of pictures there would show nothing the words do not.

## Boards

**A board's columns are lanes sunk through its pane to the page's ground, and its cards stand in them as modules stand on the ground.** A `Board` fills a pane. Each `BoardColumn` takes the ground's colour, so the pane reads as cut through where its lanes run, and each `BoardCard` is raised in its lane: the hairline and the surface shadow, a step higher under the pointer, a box that can be picked up. It is the one raised box inside a surface, and it keeps the rule: the card stands on ground, the lane's, not on the pane. What a board card holds is text and its own controls, never a tile or a frame. The Tasks demo's board is one, and a task's details open as a pane of their own beside it ([Reordering](/ui/guidelines/patterns/reordering/index.md#boards)).

## Edges

Every box takes one edge, the hairline rule: a card's, a pane's, a frame's, and the line that rules a frame's lid off from its block. The darker edge of a key belongs to what is pressed or typed into, a button, a select, a field, where it shows where the control is; round a block of code it would outweigh the code. A frame or a card in an intent draws its edge in the status colour. A line is drawn once: a pane's edge where it meets its neighbour is the pane's `edge`, and a rule a card's header already draws needs no `Separator` under it.

## Under other styles

A style redraws each layer where it stands. Under raymond a card is a group box, a document pane and a block are sunken wells in the window colour, and a link to another place has no fill, its title underlined in the link colour. A frame in an intent keeps raymond's face and edge, and its lid becomes a window's caption in the status colour; a card in one writes its legend in that colour. A block with a ground of its own, a terminal's or a video's, keeps it in the well. What holds what is the same in every style, so a screen built by these rules reads right in each of them ([Styles](/ui/guidelines/foundations/styles/index.md)).

## In the demos

- [Tasks](/ui/demos/tasks/index.md): Switch to Board: each column is a lane sunk through the pane to the page's ground, and each task a card raised in it, standing on the lane rather than on the pane; the details still open as a pane beside it.
