List-detail
A list of items beside the details of the selected one, stacked on narrow screens.
Our choice: No standard exists: real links beside a detail region, placed with CSS grid, so history and URLs keep working.
Live example
Orders and the selected order
<div data-list-detail>
<nav aria-label="Orders">
<ul>
<li><a href="?order=1042" aria-current="page">Order 1042 <small>Ada Lovelace · €1,240.00</small></a></li>
<li><a href="?order=1041">Order 1041 <small>Alan Turing · €48.50</small></a></li>
<li><a href="?order=1040">Order 1040 <small>Grace Hopper · €310.25</small></a></li>
<li><a href="?order=1039">Order 1039 <small>Katherine Johnson · €72.00</small></a></li>
<li><a href="?order=1038">Order 1038 <small>Hedy Lamarr · €615.90</small></a></li>
<li><a href="?order=1037">Order 1037 <small>Margaret Hamilton · €2,105.00</small></a></li>
</ul>
</nav>
<section aria-labelledby="order-1042-title" tabindex="0">
<h3 id="order-1042-title">Order 1042</h3>
<p><span data-badge="success">Shipped</span> Placed on 12 March 2025 by Ada Lovelace, Analytical Engines Ltd.</p>
<dl>
<dt>Ship to</dt>
<dd>12 St James's Square, London SW1Y 4JH</dd>
<dt>Carrier</dt>
<dd>DHL Express, tracking 4207 1893 22</dd>
<dt>Payment</dt>
<dd>Invoice INV-2025-0318, due 11 April 2025</dd>
</dl>
<section data-scroll="inline" aria-labelledby="order-1042-lines" tabindex="0">
<table>
<caption id="order-1042-lines">Order lines</caption>
<thead>
<tr><th scope="col">Item</th><th scope="col">Quantity</th><th scope="col">Price</th><th scope="col">Total</th></tr>
</thead>
<tbody>
<tr><td>Brass gear set</td><td>4</td><td>€180.00</td><td>€720.00</td></tr>
<tr><td>Punch card reader</td><td>1</td><td>€440.00</td><td>€440.00</td></tr>
<tr><td>Shipping</td><td>1</td><td>€80.00</td><td>€80.00</td></tr>
</tbody>
</table>
</section>
<p class="cluster">
<a href="?order=1042&view=new-invoice" data-button>Create invoice</a>
<a href="?order=1042&view=packing-slip" data-button>Print packing slip</a>
</p>
</section>
</div>
Customers, compact
<div data-list-detail data-density="compact">
<nav aria-label="Customers">
<ul>
<li><a href="?customer=c-118" aria-current="page">Analytical Engines Ltd. <small>London</small></a></li>
<li><a href="?customer=c-117">Bletchley Instruments <small>Milton Keynes</small></a></li>
<li><a href="?customer=c-116">Cobol Systems BV <small>Utrecht</small></a></li>
<li><a href="?customer=c-115">Orbital Mechanics GmbH <small>Bremen</small></a></li>
</ul>
</nav>
<article aria-labelledby="customer-118-title">
<h3 id="customer-118-title">Analytical Engines Ltd.</h3>
<dl>
<dt>Contact</dt>
<dd>Ada Lovelace, ada@analytical-engines.example</dd>
<dt>Payment terms</dt>
<dd>30 days net</dd>
<dt>Open balance</dt>
<dd>€1,240.00 (one invoice)</dd>
</dl>
<p><a href="?customer=c-118&view=orders">All orders from Analytical Engines Ltd.</a></p>
</article>
</div>
Settings page
<div data-list-detail>
<nav aria-label="Settings sections">
<ul>
<li><a href="#settings-company">Company</a></li>
<li><a href="#settings-invoicing">Invoicing</a></li>
<li><a href="#settings-notifications">Notifications</a></li>
</ul>
</nav>
<section aria-labelledby="settings-title" tabindex="0">
<h3 id="settings-title">Settings</h3>
<form data-form-sections aria-labelledby="settings-title">
<section id="settings-company" aria-labelledby="settings-company-title">
<header>
<h4 id="settings-company-title">Company</h4>
<p>Shown on invoices, quotes and delivery notes.</p>
</header>
<div>
<div data-field>
<label for="set-name">Legal name</label>
<input type="text" id="set-name" name="name" value="Domestic Trading Ltd." autocomplete="organization">
</div>
<div data-field>
<label for="set-vat">VAT number</label>
<input type="text" id="set-vat" name="vat" value="NL 8123 4567 B01" autocomplete="off">
</div>
<div data-field>
<label for="set-iban">IBAN</label>
<input type="text" id="set-iban" name="iban" value="NL91 ABNA 0417 1643 00" autocomplete="off">
</div>
</div>
</section>
<section id="settings-invoicing" aria-labelledby="settings-invoicing-title">
<header>
<h4 id="settings-invoicing-title">Invoicing</h4>
<p>Defaults for new invoices; each invoice can change them.</p>
</header>
<div>
<div data-field>
<label for="set-terms">Default payment terms</label>
<select id="set-terms" name="terms">
<option>14 days net</option>
<option selected>30 days net</option>
<option>60 days net</option>
</select>
</div>
<div data-field>
<label for="set-prefix">Invoice number prefix</label>
<input type="text" id="set-prefix" name="prefix" value="INV-2025-" autocomplete="off" aria-describedby="set-prefix-hint">
<p id="set-prefix-hint" data-field-hint>The next invoice is INV-2025-0319.</p>
</div>
<div data-field>
<label for="set-footer">Invoice footer</label>
<textarea id="set-footer" name="footer">Thank you for your business. Please quote the invoice number with your payment.</textarea>
</div>
</div>
</section>
<section id="settings-notifications" aria-labelledby="settings-notifications-title">
<header>
<h4 id="settings-notifications-title">Notifications</h4>
<p>Emails sent to the finance team.</p>
</header>
<fieldset>
<legend>Email me when</legend>
<label><input type="checkbox" name="notify-overdue" checked> An invoice is overdue</label>
<label><input type="checkbox" name="notify-paid" checked> An invoice is paid</label>
<label><input type="checkbox" name="notify-credit"> A credit note is issued</label>
</fieldset>
</section>
<footer data-action-bar>
<button type="submit">Save settings</button>
<button type="reset">Discard changes</button>
</footer>
</form>
</section>
</div>
Attributes
| Attribute or value | Where | Effect |
|---|---|---|
data-list-detail | the wrapper | the list beside (or above) the detail |
<nav aria-label> or <div> | first child: the list, a <ul> or <ol> whose items are each one <a href> (or <button>) | |
<section> or <article> with aria-labelledby | second child: the detail | |
aria-current="page" | the selected link, or its <li> | the selected item |
aria-current="true" | the selected <button>, or its <li> | the selected item |
Breakpoint
40rem of the wrapper's own inline size. A container query condition cannot read a custom property, so it is written as a length; to move it, write your own @container dui-list-detail rule.
Keyboard
| Key | Action |
|---|---|
| Tab | moves through the list links, then into the detail pane |
| Enter | on a link, opens that item's detail |
| Arrow keys | scroll the detail pane once it has focus |
Accessibility
- Use buttons only when the detail has no URL of its own (a picker inside a dialog), with aria-current="true" on the selected one.
- It is shown like a selected data table row: a --dui-border-width-emphasis accent bar on its leading edge, a tint and bold text, so color is not the only cue (WCAG 1.4.1) and the bar has 3:1 against the surface (WCAG 1.4.11).
- In forced colors mode the tint is dropped by the browser and the bar is drawn in Highlight, so the marker stays.
- Rows are at least --dui-size-row tall (32px, 28px compact, 44px on touch; WCAG 2.5.8).
- Give it tabindex="0" when it can scroll, so keyboard users can scroll it (WCAG 2.1.1).
- Source order is list, then detail, which is also the reading and Tab order in both layouts (WCAG 1.3.2, 2.4.3).
- When a link loads a new detail, move focus to the detail's heading or leave it on the link; never move it without a page load.
Specifications
- MDN CSS grid layout
- WCAG 1.4.10 Reflow
- MDN Container queries
- MDN
aria-current - WCAG Meaningful sequence
- WCAG Use of color
- WCAG Non text contrast
- MDN
forced-colors
See also
- Layouts
- Source:
css/layout/list-detail.css,examples/layouts/list-detail.html - Demos: Orders view (Plain HTML, React, Angular, Astro, Vue, Svelte)
How other systems do it
For comparison only; these are not the standard this system follows.
- Apple Human Interface Guidelines: Split views
- Material Design 3: Canonical layout examples: List-detail
- Vercel Geist: No equivalent