npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-list-detail.json --yesList detail
ProA list with the open record beside it, the list in a narrow column and the record in a centred reading column, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ListDetailListThe list's region
- ListDetailItemOne record's row
- ListDetailTriggerThe control that opens its row's record
- ListDetailPanelThe open record
import { useState } from 'react';
import { AppFrame, AppFramePanel, AppFrameRail } from '@/components/goop/patterns/app-frame';
import {
ListDetail,
ListDetailItem,
ListDetailList,
ListDetailPanel,
ListDetailTrigger,
} from '@/components/goop/patterns/list-detail';
const NOTES = [
{ id: 'survey', name: 'Survey', line: 'The lower field, Saturday.' },
{ id: 'permit', name: 'Drainage permit', line: 'Forms due Friday.' },
];
function NotesPage() {
const [open, setOpen] = useState<string | null>('survey');
const note = NOTES.find((one) => one.id === open) ?? NOTES[0];
return (
<AppFrame>
<AppFrameRail aria-label="Main" />
<ListDetail value={open} onValueChange={setOpen}>
<AppFramePanel size="list" aria-label="Notes">
<ListDetailList>
{NOTES.map((one) => (
<ListDetailItem key={one.id} value={one.id}>
<ListDetailTrigger>{one.name}</ListDetailTrigger>
</ListDetailItem>
))}
</ListDetailList>
</AppFramePanel>
<ListDetailPanel title={note.name} description={note.line} placeholder={<p>Choose a note.</p>}>
<p>Bring boots.</p>
</ListDetailPanel>
</ListDetail>
</AppFrame>
);
}Choose what stands over the rows — nothing, a search, or the search with the filters in force — and see it take the rows’ own edge under the header; type to narrow the recordings, take the chip off or Clear all, open a recording beside the list (where the box is narrow, a sheet or the list’s place) and close it with Escape, the focus back on its row. The recordings and the search are the example’s own, filtered in the page; a real app narrows its rows on its server and keeps the open recording in the URL.
When to use
- A list with the open record beside it, the list in a narrow column and the record in a centred reading column.
- Also called: master-detail view or split view.
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 List detail 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-list-detail.json --yesAdd the Goop List detail to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { useState } from 'react';
import { AppFrame, AppFramePanel, AppFrameRail } from '@/components/goop/patterns/app-frame';
import {
ListDetail,
ListDetailItem,
ListDetailList,
ListDetailPanel,
ListDetailTrigger,
} from '@/components/goop/patterns/list-detail';
const NOTES = [
{ id: 'survey', name: 'Survey', line: 'The lower field, Saturday.' },
{ id: 'permit', name: 'Drainage permit', line: 'Forms due Friday.' },
];
function NotesPage() {
const [open, setOpen] = useState<string | null>('survey');
const note = NOTES.find((one) => one.id === open) ?? NOTES[0];
return (
<AppFrame>
<AppFrameRail aria-label="Main" />
<ListDetail value={open} onValueChange={setOpen}>
<AppFramePanel size="list" aria-label="Notes">
<ListDetailList>
{NOTES.map((one) => (
<ListDetailItem key={one.id} value={one.id}>
<ListDetailTrigger>{one.name}</ListDetailTrigger>
</ListDetailItem>
))}
</ListDetailList>
</AppFramePanel>
<ListDetailPanel title={note.name} description={note.line} placeholder={<p>Choose a note.</p>}>
<p>Bring boots.</p>
</ListDetailPanel>
</ListDetail>
</AppFrame>
);
}- Fits: inbox (its recipe).
- ListDetailList: In the frame it goes in the
AppFramePanel size="list", whose body scrolls it; a heading over a group of rows is the theme'sSidebarGroupLabelin aSidebarGroup, the rows in a list under it. - ListDetailPanel: Put the record straight in with no padding of your own: the panel holds it to the reading column on the page's gutter.
- More on where it goes: list-detail--options.md
- height, width, padding, gap, corner, border, background, text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| arrangement? | ListDetailArrangement | The contract's arrangement (the catalogue's ids): Meadow draws reading-pane alone, every other id as it. |
| value? | string | null | The open record's id, when the caller holds it (with onValueChange); null: none open. |
| defaultValue? | string | null = null | The record open at first when the caller does not hold it; none by default. |
| onValueChange? | (value: string | null) => void | Hears every open and close with the record's id, or null when the record closes. |
| side? | 'start' | 'end' | Where the record sits beside the list: this theme's end (the default) or start, before it. |
- State: value (value / defaultValue / onValueChange); drawn by data-focus-visible, data-state=open
| Part | What it is |
|---|---|
| ListDetailList | The list's region; its props: list-detail--list.md |
| ListDetailItem | One record's row; takes asChild; value: string — The record's id: what the root's value holds while it is open |
| ListDetailTrigger | The control that opens its row's record; takes asChild; media?: ReactNode — What leads the record's words, inside the trigger, in a 28 px slot: the record's pack glyph (the theme's Glyph) or a person's Avatar, aria-hidden (the words name the row); also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean |
| ListDetailPanel | The open record; its props: list-detail--panel.md |
ListDetailList
The list's region.
import { ListDetailList } from '@/components/goop/patterns/list-detail';Options
- filters?: ReactNode — What narrows the rows, over them on the rows' own edge, 8 px over the first: a SearchInput, given no width.
- filtersEdge?: 'page' | 'item' = 'page' — Where the filters start and end, by where the rows start their words:
page(the default) oritem, the names of the one component API. - unreadRows?: boolean = false — The rows can be
unread(an inbox), the one component API's name.
ListDetail: every option
import { ListDetail } from '@/components/goop/patterns/list-detail';Compose
- ListDetailPanel: Its blocks (a property band, tabs, the body) follow one another; the title and words are the panel's, so never repeat them in a PageHeader of your own.
Options
- arrangement?: ListDetailArrangement — The contract's arrangement (the catalogue's ids): Meadow draws
reading-panealone, every other id as it. - value?: string | null — The open record's id, when the caller holds it (with
onValueChange);null: none open. - defaultValue?: string | null = null — The record open at first when the caller does not hold it; none by default.
- onValueChange?: (value: string | null) => void — Hears every open and close with the record's id, or
nullwhen the record closes. - side?: 'start' | 'end' — Where the record sits beside the list: this theme's
end(the default) orstart, before it. - State: value (value / defaultValue / onValueChange); drawn by data-focus-visible, data-state=open
ListDetailPanel
The open record.
import { ListDetailPanel } from '@/components/goop/patterns/list-detail';Options
- title: ReactNode — The record's name: the bar's title and the page's heading, which names the record's region.
- description?: ReactNode — The record's one line of words, 2 px under its heading.
- actions?: ReactNode — The record's own controls at the bar's end: the theme's TopBarAction, a quiet line of words.
- placeholder?: ReactNode — What the record's place holds while nothing is open (an Empty: "Choose a note"); left out, it stays empty.
- closeLabel?: string = 'Back to the list' — The name of the control that goes back to the list where the record takes its place (default "Back to the list").
Accessibility
- The native element answers the keyboard.
- hover, focus: the browser's own (:hover, :focus): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| expanded | the attribute data-state=open |
| open | the attribute data-state=open |
| current | the attribute aria-current=true |
Responsive behaviour
- In the frame, put the root in
AppFrameafter the rail, round anAppFramePanel size="list"(its header row, the list's name) holding theListDetailList, and theListDetailPanel: the list is then the frame's list column, the record its page, and on a phone the frame shows one at a time. Anywhere else the root draws the two columns itself.
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.