Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yes

Record peek

Pro

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.

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yes
PROMPT
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

  • Each option with its sentence: record-peek--options.md
  • State: open (open / defaultOpen / onOpenChange); value (value / defaultValue / onValueChange); drawn by data-dragging, data-state=closed
  • Types: RecordPeekAdapter = { get(): string | null; set(id: string | null, how: 'push' | 'replace'): void; back?(): boolean; subscribe?(listener: () => void): () => void }
Parts
PartWhat it is
RecordPeekListThe list's region
RecordPeekItemOne record's row
RecordPeekTriggerThe control that opens its row's record
RecordPeekPanelThe open record's panel
RecordPeekHeaderThe panel's top row
RecordPeekBodyThe record itself, between the header and the footer
RecordPeekFooterThe panel's foot
useRecordPeekThe 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

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

KeyWhat it does
ArrowUpStep to the previous record, outside a text field
ArrowDownStep to the next record, outside a text field
KStep 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.

goop.so/themes/trail/components/record-peek.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yes

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.