Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-page-body

Page body

Free

The area a page's content sits in, which sets how wide that content runs, for React and Tailwind CSS. Free, MIT.

When to use

  • The area a page's content sits in, which sets how wide that content runs.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Page body on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-page-body
PROMPT
Add the Goop Page body to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { pageRoles, PageBody } from '@/components/goop/patterns/page-body';
import { PageHeader, PageHeaderTitle } from '@/components/ui/goop/page-header';
import { Card, CardContent } from '@/components/ui/goop/card';
import { Field } from '@/components/ui/goop/field';
import { Switch } from '@/components/ui/goop/switch';
import { MessageList } from '@/components/ui/goop/message-list';
import { ChatMessage } from '@/components/ui/goop/chat-message';
import { Avatar } from '@/components/ui/goop/avatar';
import { Composer, ComposerEditor, ComposerToolbar, ComposerActions, ComposerSubmit } from '@/components/ui/goop/composer';

<>
  <PageBody variant="column">
    <PageHeader variant="divided">
      <PageHeaderTitle>Preferences</PageHeaderTitle>
    </PageHeader>
    <Card variant="outline" asChild>
      <ul>
        <Field as="li" label="Weekly digest">
          {(control) => <Switch {...control} />}
        </Field>
      </ul>
    </Card>
  </PageBody>
  {/* an overview, cards or a board: no padding of yours */}
  <PageBody gutter="page">
    <PageHeader variant="divided">
      <PageHeaderTitle>This week</PageHeaderTitle>
    </PageHeader>
    <Card variant="outline">
      <CardContent>Plan the March research day.</CardContent>
    </Card>
  </PageBody>
  <PageBody gutter="page" spaced={false}>
    <MessageList aria-label="Conversation" inset={false} className={`grow ${pageRoles.top}`}>
      <ChatMessage author="Fatou Diallo" avatar={<Avatar variant="solid" name="Fatou Diallo">FD</Avatar>} time="09:12">
        Can I share one study with a volunteer?
      </ChatMessage>
    </MessageList>
    <Composer variant="reply" aria-label="Reply to Fatou Diallo" onSubmit={send}>
      <ComposerEditor aria-label="Reply" placeholder="Write to Fatou Diallo…" />
      <ComposerToolbar>
        <ComposerActions>
          <ComposerSubmit aria-label="Send reply" />
        </ComposerActions>
      </ComposerToolbar>
    </Composer>
  </PageBody>
</>
  • Fits: app, chat, record, schedule, states, list (their recipes).
  • The default body has no gutter: its parts bring their own (a Table gutter="page", a divided PageHeader its sides). Under a divided header, a part with an edge of its own (a WeekBoard, a Card, a grid of cards) takes the body's gutter="page", never a padded div; a Table there takes no gutter of its own. The default body keeps no room at its foot; a column and a wide body end with a section under their last block (className="pb-0" where that block runs to the foot). Anything else in a body with no gutter (a default PageHeader, words) goes in a div with className="px-6", or the page takes column or wide. A form or a reading page sits centred; align="start" only where it must start on the list pages' edge.
  • More on where it goes: page-body--options.md
  • height, width, padding, gap: add no class for these.

API reference

Options
OptionTypeWhat it does
variantdefault | column | wide = default
align?'center' | 'start' = 'center'Where a column or a wide body sits: centred (center), or on the list pages' start edge, 24 px in (start).
gutter?'none' | 'page' = 'none'
spaced?boolean = trueWhether the body's children stand a section (32 px) apart, or as they come (false, where a holder of your own spaces them).
Parts
PartWhat it is
pageRolesThe layout's roles as class words — inset the page gutter at a panel's sides (24 px), top the top edge under the top bar (12 px), section between sections (32 px), block between a column's blocks (16 px), row between a row's controls (8 px)
  • Class recipes (cva): pageBodyVariants (PageBody)
  • data-slot values (to select a part by): page-body, page-body-content

PageBody: every option

TSX
import { PageBody } from '@/components/goop/patterns/page-body';

Compose

  • Write no margin between its children (spaced={false} where a holder of your own spaces them); your own glue takes pageRoles, never a spacing step of its own. A conversation: <PageBody gutter="page" spaced={false}>, a MessageList with inset={false} and the classes grow and pageRoles.top, then the Composer, in <AppFrame scroll="panel">. The thread fills what the box leaves and scrolls by itself; never a column or a wide body round it, nor a height of your own.

Options

  • variant: default (default), column, wide
  • align?: 'center' | 'start' = 'center' — Where a column or a wide body sits: centred (center), or on the list pages' start edge, 24 px in (start).
  • gutter?: 'none' | 'page' = 'none'
  • spaced?: boolean = true — Whether the body's children stand a section (32 px) apart, or as they come (false, where a holder of your own spaces them).

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/page-body.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-page-body

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.