A record's page with its related lists in tabs

The record's tabbed option

3 min readWritten for your agentMarkdown

The tabbed option of docs/screen-record.md: copy the file below whole in place of that recipe's file (same path, same frame). It draws RecordPage arrangement="tabbed", for a record whose related lists matter most (related: many): a client's invoices and activity, a supplier's orders, an issue's sub-issues. It is written short: its facts are words, not the default's chips edited in place — put a Properties row back exactly as docs/screen-record.md writes it.

The header holds the trail, the one main action, the heading and the record's key facts as a MetaFacts band (not the default's side panel). Under it the theme's Tabs: one tab a related list, each with its count and a countLabel a screen reader hears ("Sub-issues, 3 sub-issues"); each panel an outline Card whose CardList holds an Item a row, the whole row a link to that record (ItemOverlay). The history is a tab of its own, so the page passes no activity. The arrow keys move along the tabs, Home and End to the ends: the Tabs part's own keys. Swap the sample lists for yours (a client: Invoices and Activity), each read from your store.

`tsx tabbed // src/screens/issue.tsx: one record’s page, its related lists in tabs import { useState } from 'react'; import { RecordPage } from '@/components/goop/patterns/record-page'; import { ActivityItem, ActivityItemActor, ActivityItemAside, ActivityItemBody, ActivityItemContent, ActivityItemMedia, ActivityItemName, } from '@/components/ui/goop/activity-item'; import { Avatar, AvatarFallback } from '@/components/ui/goop/avatar'; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList } from '@/components/ui/goop/breadcrumb'; import { Button } from '@/components/ui/goop/button'; import { Card } from '@/components/ui/goop/card'; import { CardList } from '@/components/ui/goop/card-list'; import { Item, ItemContent, ItemDescription, ItemEnd, ItemMedia, ItemOverlay, ItemTitle, } from '@/components/ui/goop/item'; import { MetaFacts, MetaFactsItem, MetaFactsLabel, MetaFactsValue } from '@/components/ui/goop/meta-facts'; import { type StatusKind, StatusMark } from '@/components/ui/goop/status-mark'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/goop/tabs'; import { ScreenFrame, ScreenTopBar } from './frame'; import { hrefOf } from './router';

// ---- the sample data: swap it for yours type Status = Extract<StatusKind, 'todo' | 'in-progress' | 'in-review' | 'done'>; const STATUS_WORDS: Record<Status, string> = { todo: 'To do', 'in-progress': 'In progress', 'in-review': 'In review', done: 'Done', }; const ISSUE = { id: 'FW-121', title: 'Tags vanish after a sync on tablets', status: 'in-review' as Status, facts: [ ['Priority', 'Urgent'], ['Assignee', 'Bilal Rashed'], ['Created', '2 days ago'], ], }; const SUB_ISSUES: { id: string; title: string; status: Status; who: string }[] = [ { id: 'FW-124', title: 'Log every tag change on the tablet', status: 'done', who: 'Bilal Rashed' }, { id: 'FW-125', title: 'Keep tags while a note is open', status: 'in-progress', who: 'Dagny Holm' }, { id: 'FW-126', title: 'Check the fix on long notes', status: 'todo', who: 'Teodora Valk' }, ]; const HISTORY = [ { id: 'c1', who: 'Teodora Valk', initials: 'TV', when: '2 days ago', words: 'Saw it twice on long notes.' }, { id: 'c2', who: 'Bilal Rashed', initials: 'BR', when: 'Yesterday', words: 'Repro’d on my tablet.' }, ];

export default function IssueScreen() { const [status, setStatus] = useState(ISSUE.status); const done = status === 'done'; return ( <ScreenFrame> <RecordPage arrangement="tabbed" header={<ScreenTopBar title={ISSUE.id} />} trail={ <Breadcrumb> <BreadcrumbList> <BreadcrumbItem> <BreadcrumbLink href={hrefOf('/issues')}>Issues</BreadcrumbLink> </BreadcrumbItem> </BreadcrumbList> </Breadcrumb> } title={ISSUE.title} primaryAction={ <Button variant={done ? 'outline' : 'primary'} onClick={() => setStatus(done ? 'in-progress' : 'done')}> {done ? 'Reopen' : 'Mark as done'} </Button> } properties={ <MetaFacts aria-label="Issue facts"> <MetaFactsItem> <MetaFactsLabel>Status</MetaFactsLabel> <MetaFactsValue>{STATUS_WORDS[status]}</MetaFactsValue> </MetaFactsItem> {ISSUE.facts.map(([label, value]) => ( <MetaFactsItem key={label}> <MetaFactsLabel>{label}</MetaFactsLabel> <MetaFactsValue>{value}</MetaFactsValue> </MetaFactsItem> ))} </MetaFacts> } body={ <Tabs defaultValue="sub-issues"> <TabsList aria-label={${ISSUE.id}’s related lists}> <TabsTrigger value="sub-issues" count={SUB_ISSUES.length} countLabel={(n) => ${n} sub-issues}> Sub-issues </TabsTrigger> <TabsTrigger value="activity" count={HISTORY.length} countLabel={(n) => ${n} comments}> Activity </TabsTrigger> </TabsList> <TabsContent value="sub-issues"> <Card variant="outline"> <CardList aria-label="Sub-issues" empty={{ title: 'No sub-issue yet' }}> {SUB_ISSUES.map((one) => ( <Item key={one.id} asChild> <li> <ItemOverlay asChild> <a href={hrefOf(/issues/${one.id})} aria-labelledby={${one.id}-title} /> </ItemOverlay> <ItemMedia variant="mark"> <StatusMark status={one.status} size="sm" aria-hidden="true" /> </ItemMedia> <ItemContent> <ItemTitle id={${one.id}-title}>{one.title}</ItemTitle> <ItemDescription>{${one.id} · ${STATUS_WORDS[one.status]}}</ItemDescription> </ItemContent> <ItemEnd>{one.who}</ItemEnd> </li> </Item> ))} </CardList> </Card> </TabsContent> <TabsContent value="activity"> <ul aria-label="History"> {HISTORY.map((entry) => ( <ActivityItem key={entry.id} asChild> <li> <ActivityItemMedia> <Avatar variant="solid" size="3xs" name={entry.who}> <AvatarFallback>{entry.initials}</AvatarFallback> </Avatar> </ActivityItemMedia> <ActivityItemContent> <ActivityItemActor> <ActivityItemName>{entry.who}</ActivityItemName> </ActivityItemActor>{' '} commented </ActivityItemContent> <ActivityItemAside>{entry.when}</ActivityItemAside> <ActivityItemBody> <p>{entry.words}</p> </ActivityItemBody> </li> </ActivityItem> ))} </ul> </TabsContent> </Tabs> } /> </ScreenFrame> ); }

Code

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.