---
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/"
---

# Record peek

A list whose open record shows in a panel over its end, for a quick look without leaving the list, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `RecordPeek`.

## Try it

Press a task to open it over the list’s end, or choose Push to open it beside the list as the list narrows, keeping whole columns; another row swaps it; step with the panel’s arrows, ↑ ↓ or J K, drag its edge, mark it done, open its full page and come back; Escape closes it and puts the focus back on the row. The line under the box says which task was opened or stepped to.

The tasks and the full page are the example’s own: a real app keeps the open record in the URL with useRecordPeek and links its full page with href.

## When to use

- A list whose open record shows in a panel over its end, for a quick look without leaving the list.

## 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 Record peek on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yes
```

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

## Usage

```tsx
import {
  RecordPeek, RecordPeekList, RecordPeekItem, RecordPeekTrigger, RecordPeekPanel, RecordPeekHeader, RecordPeekBody, RecordPeekFooter, useRecordPeek,
} from '@/components/goop/patterns/record-peek';
import { Table, TableBody, TableRow } from '@/components/ui/goop/table';
import { TableCell, TableCellLabel } from '@/components/ui/goop/table-cell';
import { Prose } from '@/components/ui/goop/prose';

function Tasks() {
  const TASKS = [
    { id: 'task-1', title: 'Write the help page on tagging', owner: 'Teodora Valk' },
    { id: 'task-2', title: 'Remove the old upload endpoint', owner: 'Yuto Sakamaki' },
    { id: 'task-3', title: 'Sort studies by last edited', owner: 'Bilal Rashed' },
  ];
  const peek = useRecordPeek();
  const task = TASKS.find((one) => one.id === peek.id);
  return (
    <RecordPeek
      open={task !== undefined}
      onOpenChange={(open) => {
        if (!open) peek.close();
      }}
      records={TASKS.map((one) => one.id)}
      value={peek.id}
      onValueChange={peek.step}
      onOpenRecord={peek.open}
      href={task ? `/tasks/${task.id}` : undefined}
      storageKey="tasks:peek"
    >
      <RecordPeekList>
        <Table columns="minmax(120px, 1fr)" gutter="page" aria-label="Tasks">
          <TableBody>
            {TASKS.map((one) => (
              <RecordPeekItem key={one.id} value={one.id} asChild>
                <TableRow>
                  <TableCell>
                    <RecordPeekTrigger>
                      <TableCellLabel>{one.title}</TableCellLabel>
                    </RecordPeekTrigger>
                  </TableCell>
                </TableRow>
              </RecordPeekItem>
            ))}
          </TableBody>
        </Table>
      </RecordPeekList>
      <RecordPeekPanel>
        <RecordPeekHeader title={task?.title ?? ''} />
        <RecordPeekBody>
          <Prose>{task ? `${task.owner} took this on.` : null}</Prose>
        </RecordPeekBody>
      </RecordPeekPanel>
    </RecordPeek>
  );
}
```

- Fits: list, board (their recipes).
- A row opens its record through its `RecordPeekTrigger`; a card or a bar of your own calls `peek.open(id)` (`useRecordPeek`). Opening another while one is open swaps it. Where the app cannot own the URL (an artifact, an embedded app), keep the open id in `useState<string | null>(null)` instead: pass `open={id !== null}`, `onOpenChange={(open) => open || setId(null)}`, `value={id}` and `onValueChange={setId}`, with no `onOpenRecord`. Put it AROUND the page, right under the top bar: the frame panel's child, the page's `PageBody` inside `RecordPeekList`, so the panel opens the content area's whole height. Never inside a list's body or a template's `collection`.
- More on where it goes: record-peek--options.md

## API reference

### Parts

- `RecordPeekList` — The list's region
- `RecordPeekItem` — One record's row
- `RecordPeekTrigger` — The control that opens its row's record
- `RecordPeekPanel` — The open record's panel
- `RecordPeekHeader` — The panel's top row
- `RecordPeekBody` — The record itself, between the header and the footer
- `RecordPeekFooter` — The panel's foot
- `useRecordPeek` — The open record in the URL

### RecordPeekBody

The record itself, between the header and the footer.

```tsx
import { RecordPeekBody } from '@/components/goop/patterns/record-peek';
```

### Options

### RecordPeekFooter

The panel's foot.

```tsx
import { RecordPeekFooter } from '@/components/goop/patterns/record-peek';
```

### Options

### RecordPeekHeader

The panel's top row.

```tsx
import { RecordPeekHeader } from '@/components/goop/patterns/record-peek';
```

### Options

- title: ReactNode — The record's name: the panel's title and its region's name.
- actions?: ReactNode — The record's own round buttons (`IconButton` or `TopBarAction`), on the title's line.
- previousLabel?: string = 'Previous record' — The previous button's spoken name.
- nextLabel?: string = 'Next record' — The next button's spoken name.
- expandLabel?: string = 'Open full page' — The full page button's spoken name.
- closeLabel?: string = 'Close' — The close button's spoken name.

### RecordPeekItem

One record's row.

```tsx
import { RecordPeekItem } from '@/components/goop/patterns/record-peek';
```

### Options

- value: string — The record's id: what the root's `value` holds while it is open.
- Also takes: asChild?: boolean

### RecordPeekList

The list's region.

```tsx
import { RecordPeekList } from '@/components/goop/patterns/record-peek';
```

### Options

### RecordPeek: every option

```tsx
import { RecordPeek } from '@/components/goop/patterns/record-peek';
```

### Compose

- ListPage draws it round its page when given `record` and `peek`. Keep the default overlay; choose `push` where the list's end columns must stay in view beside the open record (an invoice list's status and amount).

### Options

- arrangement?: RecordPeekArrangement — The contract's arrangement (the catalogue's ids): Trail draws `side-panel` alone, every other id as it.
- open?: boolean — Whether the record is open, when the caller holds it (with `onOpenChange`).
- defaultOpen?: boolean = false — Whether it is open at first, when the root holds it.
- onOpenChange?: (open: boolean) => void — Hears every open and close: its close button, Escape, the browser's fold.
- mode?: 'peek' | 'page' = 'peek' — `peek`: the record opens in the panel at the list's end.
- layout?: 'push' | 'overlay' = 'overlay' — `overlay`: the panel floats over the list's end.
- onOpenRecord?: (id: string) => void — Opens the record a row's trigger was pressed for: `useRecordPeek`'s `open`.
- records?: readonly string[] — The records' ids in the list's order, for previous and next.
- value?: string | null — The open record's id, when the caller holds it (`null` for none).
- defaultValue?: string | null — The open record's id at first, when the root holds it.
- onValueChange?: (value: string | null) => void — Called with the record stepped to (previous, next, ↑ ↓, J K) or opened.
- onPrevious?: () => void — Steps to the previous record, where you step (left out at the first: disabled).
- onNext?: () => void — Steps to the next record, where you step (left out at the last: disabled).
- href?: string — The open record's full page: "Open full page" is a link to it (a plain navigation, ⌘ Enter too).
- onExpand?: () => void | Promise<void> — Opens the full page with your router (a promise is waited for).
- storageKey?: string — The local-storage key that keeps a dragged width across a reload.
- container?: HTMLElement | null — Where the folded panel's sheet is drawn; the end of `<body>` when left out.
- State: open (open / defaultOpen / onOpenChange); value (value / defaultValue / onValueChange); drawn by data-dragging, data-state=closed

### RecordPeekPanel

The open record's panel.

```tsx
import { RecordPeekPanel } from '@/components/goop/patterns/record-peek';
```

### Options

- resizeLabel?: string = 'Resize panel' — The resize handle's spoken name.
- widthText?: (width: number) => string — The handle's width in words, for its `aria-valuetext`.
- swipeable?: boolean = true — On a phone, where the panel is a Sheet: a drag or flick of its header closes the record.

### RecordPeekTrigger

The control that opens its row's record.

```tsx
import { RecordPeekTrigger } from '@/components/goop/patterns/record-peek';
```

### Options

- Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean

## Keyboard

- ArrowUp: step to the previous record, outside a text field
- ArrowDown: step to the next record, outside a text field
- K: step to the previous record, outside a text field

## Accessibility

- The native element answers the keyboard.

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

Shortened to fit: the data-slot values, what the part already sets; what else went is in agent/ship/manifest.json.

## Related

- [Table](/themes/trail/components/table): A data table of records compared across columns, with a header row whose columns can sort.
- [Table cell](/themes/trail/components/table-cell): One cell of a data table: a value, optionally with an icon or a picture before it, inside a row.
- [Prose](/themes/trail/components/prose): A block of running text set for reading, one paragraph or several, for a description, an article or a help page.
- [Record page](/themes/trail/components/record-page): A record's page inside the app frame, such as a customer or a project, with its heading, facts and content.
