npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-record-peek.json --yesRecord peek
ProA list whose record opens in a card beside the item that opened it, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- RecordPeekListThe list's region
- RecordPeekItemOne record's box
- RecordPeekTriggerThe control that opens its item's record (the record's name, or the whole of an event's card), a
buttonby default (asChildfor the caller's own control: it keeps its look and slot, markeddata-record-peek-trigger) - RecordPeekPanelThe open record's card
- RecordPeekHeaderThe card's head
- RecordPeekBodyThe record
- RecordPeekGroupOne section of the record (its people, its place, its time)
- RecordPeekFooterThe card's foot
- useRecordPeekThe open record in the URL
import { RecordPeekFooter, useRecordPeek } from '@/components/goop/patterns/record-peek';
import { useState } from 'react';
import { WeekBoardItem } from '@/components/ui/goop/week-board';
import {
RecordPeek,
RecordPeekBody,
RecordPeekHeader,
RecordPeekItem,
RecordPeekList,
RecordPeekPanel,
RecordPeekGroup,
RecordPeekTrigger,
} from '@/components/goop/patterns/record-peek';
const EVENTS = [
{ id: 'hedge', time: '10:00', title: 'Hedge planting' },
{ id: 'barn', time: '14:00', title: 'Barn meeting' },
];
function DayEvents() {
const [id, setId] = useState<string | null>(null);
const event = EVENTS.find((e) => e.id === id);
return (
<RecordPeek
open={id !== null}
onOpenChange={(open) => open || setId(null)}
records={EVENTS.map((e) => e.id)}
value={id}
onValueChange={setId}
href={`/events/${id}`}
>
<RecordPeekList className="gap-1">
{EVENTS.map((e) => (
<RecordPeekItem key={e.id} value={e.id}>
<RecordPeekTrigger asChild>
<WeekBoardItem time={e.time} title={e.title} />
</RecordPeekTrigger>
</RecordPeekItem>
))}
</RecordPeekList>
<RecordPeekPanel>
<RecordPeekHeader title={event?.title} description="By the north hedge" />
<RecordPeekBody>
<RecordPeekGroup icon="tabler-outline:clock">{event?.time}</RecordPeekGroup>
</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 record opens in a card beside the item that opened it.
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>/meadow-record-peek.json --yesAdd the Goop Record peek to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { RecordPeekFooter, useRecordPeek } from '@/components/goop/patterns/record-peek';
import { useState } from 'react';
import { WeekBoardItem } from '@/components/ui/goop/week-board';
import {
RecordPeek,
RecordPeekBody,
RecordPeekHeader,
RecordPeekItem,
RecordPeekList,
RecordPeekPanel,
RecordPeekGroup,
RecordPeekTrigger,
} from '@/components/goop/patterns/record-peek';
const EVENTS = [
{ id: 'hedge', time: '10:00', title: 'Hedge planting' },
{ id: 'barn', time: '14:00', title: 'Barn meeting' },
];
function DayEvents() {
const [id, setId] = useState<string | null>(null);
const event = EVENTS.find((e) => e.id === id);
return (
<RecordPeek
open={id !== null}
onOpenChange={(open) => open || setId(null)}
records={EVENTS.map((e) => e.id)}
value={id}
onValueChange={setId}
href={`/events/${id}`}
>
<RecordPeekList className="gap-1">
{EVENTS.map((e) => (
<RecordPeekItem key={e.id} value={e.id}>
<RecordPeekTrigger asChild>
<WeekBoardItem time={e.time} title={e.title} />
</RecordPeekTrigger>
</RecordPeekItem>
))}
</RecordPeekList>
<RecordPeekPanel>
<RecordPeekHeader title={event?.title} description="By the north hedge" />
<RecordPeekBody>
<RecordPeekGroup icon="tabler-outline:clock">{event?.time}</RecordPeekGroup>
</RecordPeekBody>
</RecordPeekPanel>
</RecordPeek>
);
}- Fits: list, schedule (their recipes).
- Put it round the list whose items open records (a week of events, a list of to-dos): each item a
RecordPeekItem, the item's own control (a WeekBoardItem, a row's title) lent to aRecordPeekTriggerwithasChild. Keep the open id in state (value/onValueChange) when the page needs it; the card's words are the record's own, inRecordPeekGroups with the theme's icons in their gutter. - height, width, padding, gap, corner, border, background, text, motion: add no class for these.
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=open
- 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 box; its props: record-peek--item.md |
| RecordPeekTrigger | The control that opens its item's record (the record's name, or the whole of an event's card), a button by default (asChild for the caller's own control: it keeps its look and slot, marked data-record-peek-trigger); its props: record-peek--trigger.md |
| RecordPeekPanel | The open record's card; its props: record-peek--panel.md |
| RecordPeekHeader | The card's head; its props: record-peek--header.md |
| RecordPeekBody | The record |
| RecordPeekGroup | One section of the record (its people, its place, its time); its props: record-peek--group.md |
| RecordPeekFooter | The card's foot |
| useRecordPeek | The open record in the URL |
RecordPeekGroup
One section of the record (its people, its place, its time).
import { RecordPeekGroup } from '@/components/goop/patterns/record-peek';Options
- icon?: IconName — The section's mark in the gutter: a pack icon's name (
tabler-outline:clock).
RecordPeekHeader
The card's head.
import { RecordPeekHeader } from '@/components/goop/patterns/record-peek';Options
- title: ReactNode — The record's name: the card's name.
- description?: ReactNode — A line under the title, in the muted ink (a note, a place).
- media?: ReactNode — The record's own mark in the gutter before the title (a to-do's Checkbox).
- actions?: ReactNode — The caller's own buttons, before previous and next (the theme's 28 px IconButtons).
- previousLabel?: string = 'Previous record' — The previous button's name (default "Previous record").
- nextLabel?: string = 'Next record' — The next button's name (default "Next record").
- expandLabel?: string = 'Open full page' — The full page's control's name (default "Open full page").
- closeLabel?: string = 'Close' — The close button's name (default "Close").
RecordPeekItem
One record's box.
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
RecordPeek: every option
import { RecordPeek } from '@/components/goop/patterns/record-peek';Options
- arrangement?: RecordPeekArrangement — The contract's arrangement (the catalogue's ids): Meadow draws
anchoredalone, 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: a trigger, the close button, Escape, a press outside the card.
- mode?: 'peek' | 'page' = 'peek' —
peek: the record opens in the card beside its item. - layout?: 'push' | 'overlay' = 'overlay' — Trail's two forms, taken so code written for either theme runs on both: Meadow's card always floats beside its item over the list (
overlay, the default);push, where Trail narrows the list beside its panel, draws the same card, the list keeping its whole width under it. - onOpenRecord?: (id: string) => void — Opens the record a trigger was pressed for:
useRecordPeek'sopen. - records?: readonly string[] — The records' ids in the list's order, for previous and next (with
valueandonValueChange). - value?: string | null — The open record's id among
records, when the caller holds it (nullfor none). - defaultValue?: string | null — The open record's id at first, when the root holds it: given (
nullfor none), the root keeps the open record itself as triggers open it and previous and next step, tellingonValueChange. - onValueChange?: (value: string | null) => void — Called with the record a trigger opened or previous, next, ↑ ↓ or K J stepped to.
- onPrevious?: () => void — Steps to the previous record, where the caller steps itself (leave it out at the first: disabled).
- onNext?: () => void — Steps to the next record, where the caller steps itself (leave it out at the last: disabled).
- href?: string — The open record's full page: "Open full page" is a link to it (⌘ Enter too).
- onExpand?: () => void | Promise<void> — Opens the full page with your router; with an
hreftoo, the link keeps its new-tab clicks. - storageKey?: string — The local-storage key that keeps a dragged width across a reload.
- container?: HTMLElement | null — Where the card is drawn; the end of
<body>when left out. - State: open (open / defaultOpen / onOpenChange); value (value / defaultValue / onValueChange); drawn by data-dragging, data-state=open
RecordPeekPanel
The open record's card.
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 — Trail's: on a phone, where its panel is a Sheet, a drag of its header closes the record.
RecordPeekTrigger
The control that opens its item's record (the record's name, or the whole of an event's card), a button by default (asChild for the caller's own control: it keeps its look and slot, marked data-record-peek-trigger).
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.
Motion
- The part sets its own motion: add no transition or animation of your own.
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.