---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# App frame

The window every page of the app sits in, with the navigation at its side and the top bar over the page, for React and Tailwind CSS. Free, MIT.

Free. Its export: `AppFrame`.

## Try it

Press a sidebar row (or Tab to it and press Enter) to open its page beside it; opening Inbox reads its notices, so its count goes. On a phone-sized window the same five pages stand in a bar across the frame’s foot, where a press (or Enter or Space) opens a page the same way, and the top bar’s button opens the sidebar in a sheet. In a theme whose frame is the icon rail (Meadow), the rail’s icons switch the section (its tile goes home, its plus adds a note, the avatar opens your account), the list column’s rows open their page beside it, and the list’s toggle folds it into the rail and back.

The pages, the notes and the notices are our own sample, and live in this page alone.

## When to use

- The window every page of the app sits in, with the navigation at its side and the top bar over the page.

## 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 App frame on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

```sh
npx shadcn@4.23.1 add @goop/trail-app-frame
```

```text
Add the Goop App frame to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { AppFramePanelSeam, AppFrame, AppFrameRail, AppFramePanel, AppFrameSecondPanel, AppFrameFooter, AppFrameTrigger, AppFrameSecondPanelTrigger } from '@/components/goop/patterns/app-frame';
import { Sidebar, SidebarHeader, SidebarHeaderRow, SidebarContent } from '@/components/ui/goop/sidebar';
import { WorkspaceSwitcher, WorkspaceSwitcherTrigger, WorkspaceSwitcherContent, WorkspaceSwitcherItem } from '@/components/ui/goop/workspace-switcher';
import { SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem } from '@/components/ui/goop/sidebar-group';
import { SidebarMenuButton } from '@/components/ui/goop/sidebar-menu-button';
import { TopBar, TopBarRow, TopBarGroup, TopBarTitle } from '@/components/ui/goop/top-bar';

<AppFrame>
  <AppFrameRail>
    <Sidebar aria-label="Main">
      <SidebarHeader>
        <SidebarHeaderRow>
          <WorkspaceSwitcher defaultValue="fieldwork">
            <WorkspaceSwitcherTrigger name="Fieldwork" />
            <WorkspaceSwitcherContent>
              <WorkspaceSwitcherItem value="fieldwork" name="Fieldwork" />
            </WorkspaceSwitcherContent>
          </WorkspaceSwitcher>
        </SidebarHeaderRow>
      </SidebarHeader>
      <SidebarContent>
        <SidebarGroup>
          <SidebarGroupContent>
            <SidebarMenu>
              <SidebarMenuItem>
                <SidebarMenuButton href="/inbox" icon="inbox" size="sm" isActive>
                  Inbox
                </SidebarMenuButton>
              </SidebarMenuItem>
            </SidebarMenu>
          </SidebarGroupContent>
        </SidebarGroup>
      </SidebarContent>
    </Sidebar>
  </AppFrameRail>
  <AppFramePanel
    header={
      <TopBar role="banner">
        <TopBarRow>
          <TopBarGroup>
            <AppFrameTrigger rail />
            <TopBarTitle>Inbox</TopBarTitle>
          </TopBarGroup>
        </TopBarRow>
      </TopBar>
    }
  >
    …
  </AppFramePanel>
</AppFrame>
```

- Fits: app, chat, flow, frame, inbox, overview, schedule, states (their recipes).
- height, width, padding, gap, corner, border, background, shadow: add no class for these.

## API reference

### Options

- `variant: default | divider = default`

- Each option with its sentence: app-frame--options.md
- State: navigationOpen (navigationOpen / defaultNavigationOpen / onNavigationOpenChange)

### Parts

- `AppFrameRail` — The navigation's column
- `AppFramePanel` — The page's `main`; its props: app-frame--panel.md
- `AppFrameSecondPanel` — A second body container beside the panel, for a page of two such as a list and its open record; its props: app-frame--second-panel.md
- `AppFrameFooter` — The strip across the frame's foot, passed to `AppFrame`'s `footer`; its props: app-frame--footer.md
- `AppFrameTrigger` — The control that opens the navigation below `wide`, first in the top bar; its props: app-frame--trigger.md
- `AppFrameSecondPanelTrigger` — The control that opens the second container's content below `wide`, at the end of the panel's top bar; its props: app-frame--second-panel-trigger.md
- `AppFramePanelSeam` — A seam for a frame composed round this one

- Class recipes (cva): appFrameVariants (AppFrame)
- data-slot values (to select a part by): app-frame, app-frame-footer, app-frame-panel, app-frame-panel-body, app-frame-panel-header, app-frame-phone-foot, app-frame-phone-nav, app-frame-rail, app-frame-second-panel, app-frame-second-panel-body, app-frame-second-panel-header, app-frame-second-panel-trigger, app-frame-trigger

### AppFrameFooter

The strip across the frame's foot, passed to `AppFrame`'s `footer`.

```tsx
import { AppFrameFooter } from '@/components/goop/patterns/app-frame';
```

### Options

- start?: ReactNode — Controls at the strip's start: quiet IconButtons.
- end?: ReactNode — Controls at the strip's end: quiet IconButtons, 2 px apart.

### AppFrame: every option

```tsx
import { AppFrame } from '@/components/goop/patterns/app-frame';
```

### Options

- variant: default (default), divider
- arrangement?: AppFrameArrangement — The contract's arrangement (the catalogue's ids): Trail draws `sidebar` alone, every other id as it.
- scroll?: 'page' | 'panel' — What scrolls below `wide`: `page` (the default) the document, the header sticking at the top; or `panel` the panel's body in a frame of the window's height, for a part pinned under the content (a conversation's composer).
- footer?: ReactNode — The strip across the foot, an `AppFrameFooter`; none if left out.
- navigationOpen?: boolean — Whether the navigation is open below `wide`, when the caller holds it.
- defaultNavigationOpen?: boolean = false — Whether the navigation starts open, when the frame holds it.
- onNavigationOpenChange?: (open: boolean) => void — Called as the navigation opens or closes.
- navigationLabel?: string = 'Navigation' — The open navigation's spoken name.
- navigationCloseLabel?: string = 'Close navigation' — Its close control's spoken name.
- container?: HTMLElement | null — Where the open navigation is drawn; the end of `<body>` when left out.
- phoneNav?: ReactNode — A phone's bottom navigation, across the foot below `narrow`: the theme's TabBar of the app's places (five or fewer; more keep the menu button's sheet alone).
- State: navigationOpen (navigationOpen / defaultNavigationOpen / onNavigationOpenChange)

### AppFramePanel

The page's `main`.

```tsx
import { AppFramePanel } from '@/components/goop/patterns/app-frame';
```

### Options

- header?: ReactNode — Its header, never scrolled with the body: a TopBar, `role="banner"`.
- size?: 'fill' | 'list' = 'fill' — Beside an `AppFrameSecondPanel`: `fill` shares the row, `list` takes a list's narrower width.

### AppFrameSecondPanelTrigger

The control that opens the second container's content below `wide`, at the end of the panel's top bar.

```tsx
import { AppFrameSecondPanelTrigger } from '@/components/goop/patterns/app-frame';
```

### Options

- children?: ReactElement — The control that opens the second container's content; a quiet `TopBarAction` if left out.
- label?: string = 'Show details' — The spoken name of the theme's own control.

### AppFrameSecondPanel

A second body container beside the panel, for a page of two such as a list and its open record.

```tsx
import { AppFrameSecondPanel } from '@/components/goop/patterns/app-frame';
```

### Options

- header?: ReactNode — Its header, never scrolled with the body: a TopBar.
- inPlace?: boolean = false — Below the fold, takes the first container's place.
- open?: boolean — Whether its content is open in its sheet below `wide`, when the caller holds it.
- defaultOpen?: boolean = false — Whether its content starts open in its sheet below `wide`, when the container holds it.
- onOpenChange?: (open: boolean) => void — Called as its sheet opens or closes: by its trigger, its close control, Escape, the scrim, or the window reaching `wide`.
- closeLabel?: string = 'Close' — Its sheet's close control's spoken name.

### AppFrameTrigger

The control that opens the navigation below `wide`, first in the top bar.

```tsx
import { AppFrameTrigger } from '@/components/goop/patterns/app-frame';
```

### Options

- children?: ReactElement — The control that opens the navigation; a quiet `TopBarAction` if left out.
- label?: string = 'Show navigation' — The spoken name of the theme's own control.
- rail?: boolean = false — From `wide` up, the rail's Sidebar's collapse toggle in the trigger's place (none drawn where there is no Sidebar).

## Accessibility

- focus-visible: the browser's own (:focus-visible): write nothing

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

## Related

- [Sidebar](/themes/trail/components/sidebar): The app's main navigation down one side of the window.
- [Workspace switcher](/themes/trail/components/workspace-switcher): The sidebar's menu that shows the current workspace and switches to another or creates one.
- [Sidebar group](/themes/trail/components/sidebar-group): A titled group of links in the sidebar, such as a team's pages or your projects, that can fold open and closed.
- [Sidebar menu button](/themes/trail/components/sidebar-menu-button): One row of the sidebar, its icon and words, that opens a page or runs an action and shows which page is current.
