Skip to content

Signal

Components

List–detail split

Side-by-side panes that become swipeable steps on compact screens: .ct-split and .ct-pane.

List–detail panes in a .ct-view: fixed-width list panes and a detail pane that fills the rest. On compact screens each pane becomes a full-width step; selecting a row scrolls to its detail and a back bar returns.

Live example

The real classes from /site/chitransit.css in frames at phone, tablet and desktop widths, in the docs theme. The contract below shows each width in light and dark.

Phone · 390 × 760
Tablet · 768 × 900
Desktop · 1280 × 800

Code

<section class="ct-view ct-split" aria-label="Stations">
  <div class="ct-pane ct-pane--list">
    <div class="ct-pane-head">
      <h2 class="ct-pane-title">Stations</h2>
      <p class="ct-pane-sub">145 'L' stations</p>
      <label class="ct-search">…</label>
    </div>
    <div class="ct-pane-body">…rows…</div>
  </div>
  <div class="ct-pane ct-pane--fill">
    <div class="ct-pane-nav"><button class="ct-link-button ct-pane-back" type="button">‹ Stations</button></div>
    <div class="ct-pane-body ct-pane-body--detail">
      <div class="ct-page ct-page--reading">…</div>
    </div>
  </div>
</section>

Responsive behavior

ViewportLayout
> 900 widePanes side by side: --narrow 320, --list 380, --wide 440, --fill takes the rest; hairlines between them.
≤ 900 wide or ≤ 500 tallEvery pane is full width; the split scrolls sideways, snapping one pane at a time. Detail panes show their .ct-pane-nav back bar.

Tokens

From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.

Custom propertyValueAliasResolves to
--ct-split-back-font-sizevar(--fs-body){type.body}16
--ct-split-back-padding-xvar(--space-10){space.s10}10 pt
--ct-split-body-padding-bottomvar(--space-32){space.s32}32 pt
--ct-split-body-padding-top-detailvar(--space-20){space.s20}20 pt
--ct-split-head-gapvar(--space-10){space.s10}10 pt
--ct-split-head-padding-bottomvar(--space-12){space.s12}12 pt
--ct-split-head-padding-top-compactvar(--space-12){space.s12}12 pt
--ct-split-head-padding-topvar(--space-16){space.s16}16 pt
--ct-split-nav-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-split-nav-bordervar(--line){colors.line}#DADDE3 #263041
--ct-split-nav-heightvar(--size-minimum-tap-target){size.minimumTapTarget}44 pt
--ct-split-pane-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-split-pane-bordervar(--line){colors.line}#DADDE3 #263041
--ct-split-pane-width-listvar(--size-pane-list){size.paneList}380 pt
--ct-split-pane-width-narrowvar(--size-pane-narrow){size.paneNarrow}320 pt
--ct-split-pane-width-widevar(--size-pane-wide){size.paneWide}440 pt
--ct-split-sub-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-split-sub-font-sizevar(--fs-sub){type.sub}13
--ct-split-title-font-sizevar(--fs-title){type.title}20
--ct-split-title-font-weightvar(--weight-bold){weight.bold}700
--ct-split-title-gapvar(--space-10){space.s10}10 pt
--ct-split-title-min-heightvar(--size-minimum-tap-target){size.minimumTapTarget}44 pt

Variants

A pane takes one width: .ct-pane--narrow (320), --list (380), --wide (440) or --fill (the rest). .ct-pane-body--detail adds space above a detail column. Nothing else exists.

<!-- Do -->
<section class="ct-view ct-split" aria-label="Stations">
  <div class="ct-pane ct-pane--list">…</div>
  <div class="ct-pane ct-pane--fill">…</div>
</section>
<!-- Don't: a split inside a split -->
<div class="ct-pane ct-pane--fill">
  <div class="ct-split">…</div>
</div>

Usage

Do

  • Scroll the detail pane into view when a row is selected on a compact screen, and back with the back bar.
  • Put detail content in a .ct-page--reading column so lines stay readable on wide screens.

Don't

  • Don't make swiping the only way back.
  • Don't nest splits.

Accessibility

  • Name each pane by its title; name the back bar by its destination.
  • Move focus to the detail's heading when a row opens it on a compact screen.
  • On compact screens set inert on every pane scrolled out of view and clear it on the pane in view, so focus never lands off screen. No pane is inert on wide screens.

Contract

Contract: components/split.yaml. States are drawn live by transit.js.