List-detail layout
ProM3's list-detail canonical layout, sized by its own width: one pane at a time below 840px, the list beside the open item from 840px. For settings, an inbox or a dashboard. Not an M3 component (@windmorph/react-pro).
import { ListDetailLayout } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Props
ListDetailLayout 17 props
The list pane's content, usually a
Listofhrefitems with the open one selected.The detail pane's content: the open item.
The pane to show when only one fits (the layout narrower than 840px):
"list"on the list's route,"detail"on an item's route. From 840px wide both panes show.The list pane's accessible name, for example "Settings".
The detail pane's accessible name, for example the open section's title.
navwhen the list navigates between pages (settings);sectionotherwise (an inbox).Shown at the top of the detail pane in single-pane mode only, to return to the list: usually an
IconButtonlink with a translated label.The page's heading, said again at the start of the detail pane while only the detail shows (narrower than 840px), where the list and its heading are gone: visually hidden, so the outline still reads the page, then the item, at every width (axe
page-has-heading-one). From 840px, with the list beside it, it isn't there. Usually the list's own heading's words.The level of
pageHeading.Identifies the open item, usually the pathname. When it changes in single-pane mode, focus moves to the pane that's now showing. Render the layout in a shared route layout so it persists between items.
plain: panes on the page's surface.filled: each pane is a container.The list pane's width with two panes (a CSS length), at every layout width from 840px. It is also the layout's own width in a parent that sizes to its content, so give a length, not a percentage, which gives it none there. Sets
--wm-list-detail-layout-list-width.Where the sticky list pane stops below a sticky top app bar (a CSS length). Sets
--wm-list-detail-layout-sticky-top.Ref to the root element.
Classes for each part; they win over the defaults via
cn().The root: the size container whose width decides one pane or two.
The panes' wrapper: the grid (one pane) or row (two panes).
The list pane (
navorsection).The detail pane (
section).The wrapper of the
backslot.The page's heading in the detail pane, shown only to assistive technology.
Classes for the root element, merged with the component's own (yours win).
Inline styles for the root element.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
Spec status
Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.
| Item | Status | Details |
|---|---|---|
Plain panes (variant="plain") | Built | Variant · Settings |
Filled panes (variant="filled") | Built | Variant · Inbox |
A navigating list (listAs="nav"), such as settings | Built | Configuration · Settings |
A list of items (listAs="section"), such as an inbox | Built | Configuration · Inbox |
| One pane at a time below 840px, with Back | Built | Configuration · Settings, Inbox |
M3 Expressive specs
- Shape
rounded-corner-large- Variants
plain, filled
Theming & tokens
- Only colour roles: filled panes use
surface-container-lowwith large corners, and keep a border in forced-colours mode, so it follows every theme, mode and contrast level. - Set the tokens below on the layout or any ancestor (its root carries
data-tokens="wm-list-detail-layout");listWidthandstickyTopsetlist-widthandsticky-topfor one layout. The old--wm-list-detail-list-widthand--wm-list-detail-sticky-topare now--wm-list-detail-layout-list-widthand--wm-list-detail-layout-sticky-top. - Override any part with
classNameandclassNames(root, the size container; panes, the grid or row holding them; list, detail, back, pageHeading).
| Variable | Default | Paints |
|---|---|---|
--wm-list-detail-layout-list-width | 360px | The list pane’s width on expanded windows (840px and up). |
--wm-list-detail-layout-list-width-large | var(--wm-list-detail-layout-list-width, 412px) | The list pane’s width on large windows (1200px and up); `list-width` when only that is set. |
--wm-list-detail-layout-spacer | 24px | Between the two panes. |
--wm-list-detail-layout-sticky-top | 0px | Where the sticky list pane stops, below a sticky top app bar. |
--wm-list-detail-layout-available-height | 100dvh | The height the list pane may take beside the detail, less `sticky-top`: the window’s by default. A container that scrolls by itself and is shorter than the window (an app frame’s pane, a dialog) sets it to its own height, so the list ends at its edge and scrolls to its last row. |
--wm-list-detail-layout-pane-container-color | transparentVaries with variant. | Each pane’s container (`surface-container-low` when `filled`). |
--wm-list-detail-layout-pane-shape | var(--md-sys-shape-corner-none)Varies with variant. | Each pane’s corners (`large` when `filled`). |