---
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/"
---

# The list page with totals and a pager at the foot

The list's foot option

The `foot` option of `docs/screen-list.md`: copy the file below whole in place of that recipe's file (same path, same frame). It is written short: it keeps the search and the row's menu, and leaves out the status filter, the stepper and the peek — put back any of them exactly as `docs/screen-list.md` writes them. It draws ListPage `arrangement="filtered"`; the chooser (`agent/layout-chooser.md`) names the others, the same slots.

## `foot`: totals and the pager pinned at the table's foot

A `TableFooter` after the body: a totals `TableRow` (the rows counted in the first cell, the estimates' total in its own column, `TableCell numeric` with a `TableCellLabel primary`) and a `TableFooterBar` holding the rows shown and the theme's `Pagination`. In `ListPage` the table takes the height the panel leaves, so its rows scroll between its header and its foot, both pinned. The totals count every row the search leaves, not only the page shown; a new search starts again on page 1. Put the page in your router's address (`?page=`) as `href` does, so a page can be shared.

```tsx foot // src/screens/issues.tsx: the list page with totals and a pager at its foot import { useState } from 'react'; import { ListPage } from '@/components/goop/patterns/list-page'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/goop/dropdown-menu'; import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from '@/components/ui/goop/empty'; import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button'; import { PageHeader, PageHeaderTitle } from '@/components/ui/goop/page-header'; import { Pagination, PaginationPages } from '@/components/ui/goop/pagination'; import { PriorityMark } from '@/components/ui/goop/priority-mark'; import { SearchInput } from '@/components/ui/goop/search-input'; import { StatusMark } from '@/components/ui/goop/status-mark'; import { Table, TableBody, TableFooter, TableFooterBar, TableHead, TableHeader, TableRow, } from '@/components/ui/goop/table'; import { TableCell, TableCellLabel, TableCellPerson } from '@/components/ui/goop/table-cell'; import { ScreenFrame, ScreenTopBar } from './frame'; import { hrefOf } from './router';

// ---- the sample data: swap it for yours type Status = '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', }; interface Issue { id: string; title: string; status: Status; priority: 'urgent' | 'high' | 'medium' | 'low'; assignee: string; /** Points; null for not estimated. */ estimate: number | null; } const ME = 'Teodora Valk'; const ISSUES: Issue[] = [ { id: 'FW-121', title: 'Tags vanish on sync', status: 'in-review', priority: 'urgent', assignee: 'Bilal Rashed', estimate: 3, }, { id: 'FW-117', title: 'Recruit 8 participants', status: 'todo', priority: 'high', assignee: 'Dagny Holm', estimate: 5, }, { id: 'FW-110', title: 'Help page on tags', status: 'in-progress', priority: 'low', assignee: 'Teodora Valk', estimate: 1, }, { id: 'FW-108', title: 'Waveform stutters', status: 'done', priority: 'medium', assignee: 'Ngozi Ilori', estimate: 2, }, ]; /** Rows a page holds: 25 in your app; 3 here, so the four sample issues take two pages. */ const PAGE_SIZE = 3; const counted = (n: number) => `${n} ${n === 1 ? 'issue' : 'issues'}`;

export default function IssuesScreen() { const [issues, setIssues] = useState(ISSUES); const [query, setQuery] = useState(''); const [page, setPage] = useState(1); const found = issues.filter((issue) => `${issue.id} ${issue.title}`.toLowerCase().includes(query.trim().toLowerCase()), ); const pageCount = Math.max(1, Math.ceil(found.length / PAGE_SIZE)); const at = Math.min(page, pageCount); const first = (at - 1) * PAGE_SIZE; const shown = found.slice(first, first + PAGE_SIZE); const estimated = found.reduce((sum, issue) => sum + (issue.estimate ?? 0), 0); const change = (id: string, next: Partial<Issue>) => setIssues((all) => all.map((issue) => (issue.id === id ? { ...issue, ...next } : issue))); return ( <ScreenFrame current="/issues"> <ListPage arrangement="filtered" header={<ScreenTopBar title="Issues" />} heading={ <PageHeader> <PageHeaderTitle asChild> <h1>Issues</h1> </PageHeaderTitle> </PageHeader> } filters={ <SearchInput label="Search issues" placeholder="Search issues" value={query} onChange={(event) => { setQuery(event.currentTarget.value); setPage(1); }} /> } collection={ found.length === 0 ? ( <Empty variant="outline"> <EmptyHeader> <EmptyTitle>No issue matches the search.</EmptyTitle> <EmptyDescription>Try other words.</EmptyDescription> </EmptyHeader> </Empty> ) : ( <Table aria-label="Issues" gutter="page" columns={[ 'minmax(160px, 1fr)', { track: '128px', hide: 'narrow' }, { track: '96px', hide: 'narrow' }, { track: '176px', hide: 'narrow' }, '96px', '40px', ]} > <TableHeader> <TableRow> <TableHead> <TableCellLabel>Issue</TableCellLabel> </TableHead> <TableHead> <TableCellLabel>Status</TableCellLabel> </TableHead> <TableHead> <TableCellLabel>Priority</TableCellLabel> </TableHead> <TableHead> <TableCellLabel>Assignee</TableCellLabel> </TableHead> <TableHead numeric> <TableCellLabel>Estimate</TableCellLabel> </TableHead> <TableHead align="end" aria-label="Actions" /> </TableRow> </TableHeader> <TableBody> {shown.map((issue) => ( <TableRow key={issue.id}> <TableCell> <TableCellLabel primary>{issue.title}</TableCellLabel> </TableCell> <TableCell> <StatusMark status={issue.status} label={STATUS_WORDS[issue.status]} /> </TableCell> <TableCell> <PriorityMark priority={issue.priority} label /> </TableCell> <TableCell> <TableCellPerson name={issue.assignee} /> </TableCell> <TableCell numeric> <TableCellLabel>{issue.estimate ?? '–'}</TableCellLabel> </TableCell> <TableCell align="end"> <DropdownMenu> <DropdownMenuTrigger asChild> <IconButton variant="ghost" size="sm" aria-label={`Actions for ${issue.id}`}> <IconButtonIcon icon="dots" /> </IconButton> </DropdownMenuTrigger> <DropdownMenuContent align="end" aria-label={`Actions for ${issue.id}`}> <DropdownMenuItem disabled={issue.assignee === ME} onSelect={() => change(issue.id, { assignee: ME })} > Assign to me </DropdownMenuItem> <DropdownMenuItem disabled={issue.status === 'done'} onSelect={() => change(issue.id, { status: 'done' })} > Mark as done </DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> </TableCell> </TableRow> ))} </TableBody> <TableFooter> <TableRow> <TableCell> <TableCellLabel primary>{counted(found.length)}</TableCellLabel> </TableCell> <TableCell /> <TableCell /> <TableCell /> <TableCell numeric> <TableCellLabel primary>{estimated}</TableCellLabel> </TableCell> <TableCell /> </TableRow> <TableFooterBar summary={`${first + 1}–${first + shown.length} of ${found.length}`}> <Pagination aria-label="Pages of issues"> <PaginationPages page={at} pageCount={pageCount} href={(n) => hrefOf(`/issues?page=${n}`)} onPageChange={setPage} /> </Pagination> </TableFooterBar> </TableFooter> </Table> ) } /> </ScreenFrame> ); }

```

```
