---
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 record opens in a card beside the item that opened it, 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 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.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-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 { 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 a `RecordPeekTrigger` with `asChild`. Keep the open id in state (`value` / `onValueChange`) when the page needs it; the card's words are the record's own, in `RecordPeekGroup`s with the theme's icons in their gutter.
- height, width, padding, gap, corner, border, background, text, motion: add no class for these.

## API reference

### Parts

- `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).

```tsx
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.

```tsx
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.

```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

### RecordPeek: every option

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

### Options

- arrangement?: RecordPeekArrangement — The contract's arrangement (the catalogue's ids): Meadow draws `anchored` 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: 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`'s `open`.
- records?: readonly string[] — The records' ids in the list's order, for previous and next (with `value` and `onValueChange`).
- value?: string | null — The open record's id among `records`, when the caller holds it (`null` for none).
- defaultValue?: string | null — The open record's id at first, when the root holds it: given (`null` for none), the root keeps the open record itself as triggers open it and previous and next step, telling `onValueChange`.
- 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 `href` too, 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.

```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 — 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`).

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

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

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

## Related

- [Week board](/themes/meadow/components/week-board): A week of a schedule, rooms or people down the side and the days across, for a weekly timetable, a booking or rota board.
- [Record page](/themes/meadow/components/record-page): One record's whole page, its title, facts, content and activity in Meadow's reading column under the page's top bar.
- [Overview grid](/themes/meadow/components/overview-grid): An overview page's body, stacking a band of figures, a wide section and a pair of sections, each under its muted label.
- [Gantt](/themes/meadow/components/gantt): A timeline of dated bars for a roadmap, a schedule or a release plan.
