npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yesRecord peek
ProA 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.
What an agent sees
- 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
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>
);
}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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-record-peek.json --yesAdd the Goop Record peek to this project. The install steps are at https://goop.so/docs/install.mdUsage
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 callspeek.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 inuseState<string | null>(null)instead: passopen={id !== null},onOpenChange={(open) => open || setId(null)},value={id}andonValueChange={setId}, with noonOpenRecord. Put it AROUND the page, right under the top bar: the frame panel's child, the page'sPageBodyinsideRecordPeekList, so the panel opens the content area's whole height. Never inside a list's body or a template'scollection. - 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 }
| Part | What it is |
|---|---|
| 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.
import { RecordPeekBody } from '@/components/goop/patterns/record-peek';Options
RecordPeekHeader
The panel's top row.
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 (
IconButtonorTopBarAction), 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.
import { RecordPeekItem } from '@/components/goop/patterns/record-peek';Options
- value: string — The record's id: what the root's
valueholds while it is open. - Also takes: asChild?: boolean
RecordPeekList
The list's region.
import { RecordPeekList } from '@/components/goop/patterns/record-peek';Options
RecordPeek: every option
import { RecordPeek } from '@/components/goop/patterns/record-peek';Compose
- ListPage draws it round its page when given
recordandpeek. Keep the default overlay; choosepushwhere 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-panelalone, 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'sopen. - 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 (
nullfor 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.
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.
import { RecordPeekTrigger } from '@/components/goop/patterns/record-peek';Options
- Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean
Keyboard
| Key | What it does |
|---|---|
| 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.