Skip to content

List-detail layout

Pro

M3'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

By name or description, across the 17 props below

ListDetailLayout 17 props

  • listtype ReactNodeRequired

    The list pane's content, usually a List of href items with the open one selected.

  • detailtype ReactNodeRequired

    The detail pane's content: the open item.

  • activetype "detail" | "list"Required

    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.

  • listLabeltype stringRequired

    The list pane's accessible name, for example "Settings".

  • detailLabeltype stringRequired

    The detail pane's accessible name, for example the open section's title.

  • listAstype "nav" | "section"default "nav"

    nav when the list navigates between pages (settings); section otherwise (an inbox).

  • backtype ReactNode

    Shown at the top of the detail pane in single-pane mode only, to return to the list: usually an IconButton link with a translated label.

  • pageHeadingtype ReactNode

    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.

  • pageHeadingLeveltype 1 | 2 | 3 | 4 | 5 | 6default 1

    The level of pageHeading.

  • detailKeytype string

    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.

  • varianttype "plain" | "filled"default "plain"

    plain: panes on the page's surface. filled: each pane is a container.

  • listWidthtype stringdefault 360px, 412px from 1200px

    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.

  • stickyToptype stringdefault "0px"

    Where the sticky list pane stops below a sticky top app bar (a CSS length). Sets --wm-list-detail-layout-sticky-top.

  • reftype Ref<HTMLDivElement>

    Ref to 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.

  • 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-low with 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"); listWidth and stickyTop set list-width and sticky-top for one layout. The old --wm-list-detail-list-width and --wm-list-detail-sticky-top are now --wm-list-detail-layout-list-width and --wm-list-detail-layout-sticky-top.
  • Override any part with className and classNames (root, the size container; panes, the grid or row holding them; list, detail, back, pageHeading).
List-detail layout tokens
VariableDefaultPaints
--wm-list-detail-layout-list-width360pxThe list pane’s width on expanded windows (840px and up).
--wm-list-detail-layout-list-width-largevar(--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-spacer24pxBetween the two panes.
--wm-list-detail-layout-sticky-top0pxWhere the sticky list pane stops, below a sticky top app bar.
--wm-list-detail-layout-available-height100dvhThe 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-colortransparentVaries with variant.Each pane’s container (`surface-container-low` when `filled`).
--wm-list-detail-layout-pane-shapevar(--md-sys-shape-corner-none)Varies with variant.Each pane’s corners (`large` when `filled`).