Skip to content
GitHub (opens in a new tab)

List detail

A list of invoices beside the one you opened.

Install

Not exported from agentic-ds-kit. add copies the source into your app (components/patterns/list-detail/) with this contract beside it. You own the copy: replace the demo data, rearrange or drop sections, and keep the must lines.

npx agentic-ds-kit add list-detail

Usage

import { ListDetailPattern } from "@/components/patterns/list-detail";

<ListDetailPattern />

What a copy keeps

The contract’s must lines: the kit look and accessibility. Ask before breaking one.

  • Use kit components from agentic-ds-kit for anything the kit has; no local cousins (tables, dialogs, rows, rules, charts)
  • Semantic tokens only (agentic-ds-kit/tokens.css); no raw hex, no primitive --color-* ramps
  • At most one appearance="solid" mode="primary" Button per view
  • Do not restyle kit components; change them through their props, slots, and tokens
  • Render inside a main landmark (wrap the pattern, or your page content, in <main>); header and nav chrome, if any, use AppHeader / SideNav (or other header / nav landmarks) and nav stays reachable on small screens
  • The list is one kit ListView with selection="single" at 640 and up; the open record is the selected row
  • One URL per record (here #INV-1842; /invoices/:id in an app). The list with nothing open is its own URL
  • At 640 and up the detail sits beside the list (layout-split); with nothing open it is kit Empty that says so and offers one neutral Button
  • Below 640 the list fills the page and rows drill (interaction="drill"); the record opens full page under a bar with a ghost Invoices back button to the list, and Back returns focus to that row
  • Status is a Badge with an icon and a word, and lateness is text ("17 days late", in metaTone danger), never colour alone

Defaults you can change

  • Demo is Northwind's invoices: Overdue filter, oldest first, with search by customer or invoice
  • Invoice rows and both record lists are flush ListViews (edge-to-edge rules; the selected row fills with a 2px brand edge), and the filter is a fullWidth SegmentedControl
  • At 640 and up the list column carries the Invoices PageHeader and New invoice; the record pane has the id, a status Badge, the customer line, and Ask on the left with Download PDF and Retry payment (the one primary) on the right
  • Record body: an amount strip, Line items (Table with a total) and Payment history (ListView, oldest first)
  • Below 640 rows show the invoice number only; the record keeps item and amount in Line items and lists the latest payment first. Actions sit in the body; there is no sticky bottom bar

Built from

  • Component
    →

    PageHeader

    Top-of-page title with optional Breadcrumb trail, subtitle, actions, page Tabs, a profile Avatar and a decorative cover.

  • Component
    →

    ListView

    A list of records, one row each: primary and optional secondary line, leading avatar or icon, trailing value, badge, actions, or chevron.

  • Component
    →

    Empty

    Placeholder when a list, page, or region has nothing to show.

  • Component
    →

    Card

    Framed tile with optional header, body, and footer actions.