Back to the library

Drill-down — columns

Variant: Columns

Miller columns: the drill-down that never takes the parent away. Picking a vendor opens its invoices beside it, rows arriving 40ms apart out of the divider; picking an invoice first demotes the vendor’s highlight from clay to grey, and only then does the strip shift one column in 360ms ease-in-out — focus moves, then the layout makes room for where it went. Two strengths of selection are the whole idea: clay is where focus is, grey is a parent on the path, so the path is drawn in the lists themselves rather than restated in a breadcrumb. The columns are sized so a 14px sliver of the departed one stays on screen with its grey bar still in it; the path never fully leaves, and there is always an edge to go back to. Back is 288ms, after the child column’s rows leave together in 108ms. Reach for it in file browsers, nested settings and any tree where the siblings at each level matter as much as the depth.

transitionlayoutlistloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Drill-down — columns</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --round: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex. */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — 7.2s, so 1% is 72ms. The strip shifts for 360ms going in
           and 288ms coming back. */
        --cycle: 7.2s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

        /* Two columns share the frame with a 14px sliver left over. Before the
           shift the sliver is spare room at the right; after it, it is the
           edge of the column that went off-screen — still showing its
           selection, so the path never fully leaves. */
        --_sliver: 14px;
        --_col: calc((100% - var(--_sliver)) / 2);
        --_shift: calc(var(--_sliver) * 1.5 - 50%);
        --_dx: 6px;
        --_stagger: calc(40ms / var(--speed));
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        background: var(--ivory);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
        color: var(--slate);
      }

      .frame {
        position: relative;
        width: min(300px, calc(100vw - 32px));
        height: 182px;
        border-radius: calc(12px * var(--round));
        background: var(--paper);
        border: 1px solid color-mix(in srgb, var(--slate) 9%, transparent);
        overflow: hidden;
      }

      .strip {
        position: absolute;
        inset: 0;
        animation: shift var(--t) var(--ease-in-out) infinite;
      }

      .col {
        position: absolute;
        top: 0;
        bottom: 0;
        width: var(--_col);
        padding: 9px 6px;
        display: grid;
        align-content: start;
        gap: 3px;
        border-left: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
      }

      .c0 {
        left: 0;
        border-left: 0;
      }

      .c1 {
        left: var(--_col);
      }

      /* Before the shift the third column is only the spare sliver, and a
         divider there would announce a column that does not exist yet. Its
         edge is drawn with the shift instead. */
      .c2 {
        left: calc(2 * var(--_col));
        border-left-color: transparent;
      }

      .c2::before {
        content: '';
        position: absolute;
        left: -1px;
        top: 0;
        bottom: 0;
        border-left: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
        opacity: 0;
        animation: edge var(--t) var(--ease-out) infinite;
      }

      .cap {
        height: 18px;
        padding: 0 6px;
        font-size: 11px;
        line-height: 18px;
        color: color-mix(in srgb, var(--slate) 48%, transparent);
        white-space: nowrap;
      }

      .row {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        height: 24px;
        padding: 0 6px;
        border-radius: calc(5px * var(--round));
        font-size: 11px;
        font-weight: 500;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
        isolation: isolate;
      }

      .row .amt {
        margin-left: auto;
        font-weight: 400;
        color: color-mix(in srgb, var(--slate) 55%, transparent);
      }

      .chev {
        margin-left: auto;
        width: 8px;
        height: 8px;
        flex: none;
        color: color-mix(in srgb, var(--slate) 34%, transparent);
      }

      .chev svg {
        width: 100%;
        height: 100%;
        display: block;
      }

      .row .amt + .chev {
        margin-left: 0;
      }

      /* A selection has two strengths. Clay is where focus is; grey is a
         parent on the path. Moving focus right demotes the parent's highlight
         instead of clearing it — that is the whole difference from a push,
         where the parent would simply be gone. */
      .sel {
        position: absolute;
        inset: 0;
        z-index: -1;
        border-radius: inherit;
        opacity: 0;
        animation-duration: var(--t);
        animation-iteration-count: infinite;
        animation-timing-function: var(--ease-out);
      }

      .s0 {
        background: color-mix(in srgb, var(--clay) 16%, transparent);
        animation-name: focus-0;
      }

      .s0g {
        background: color-mix(in srgb, var(--slate) 7%, transparent);
        animation-name: path-0;
      }

      .s1 {
        background: color-mix(in srgb, var(--clay) 16%, transparent);
        animation-name: focus-1;
      }

      .empty {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 11px;
        color: color-mix(in srgb, var(--slate) 40%, transparent);
        animation: empty var(--t) var(--ease-out) infinite;
      }

      /* Entries stagger and exits do not, so they live on different layers:
         each child carries its own delayed arrival, and the column's .kids
         wrapper carries the departure, which every row shares exactly. */
      .kids {
        display: grid;
        gap: 3px;
        animation-duration: var(--t);
        animation-iteration-count: infinite;
        animation-timing-function: var(--ease-out);
      }

      .c1 .kids {
        animation-name: close-1;
      }

      .c2 .kids {
        animation-name: close-2;
      }

      .kids > * {
        opacity: 0;
        animation-duration: var(--t);
        animation-iteration-count: infinite;
        animation-timing-function: var(--ease-out);
        animation-delay: calc(var(--_i, 0) * var(--_stagger));
      }

      .c1 .kids > * {
        animation-name: open-1;
      }

      .c2 .kids > * {
        animation-name: open-2;
      }

      .kids > :nth-child(2) {
        --_i: 1;
      }

      .kids > :nth-child(3) {
        --_i: 2;
      }

      .kids > :nth-child(4) {
        --_i: 3;
      }

      .dup .amt {
        color: var(--rust);
      }

      .verdict {
        padding: 4px 6px 0;
        font-size: 11px;
        font-weight: 500;
        color: var(--rust);
        white-space: nowrap;
      }

      /* 28–33%: in, 360ms, and only after the parent's highlight has turned
         grey — focus moves first, then the strip makes room for where it
         went. 57.5–61.5%: back out, 288ms. */
      @keyframes shift {
        0%,
        28% {
          transform: translateX(0);
        }
        33%,
        57.5% {
          transform: translateX(var(--_shift));
        }
        61.5%,
        100% {
          transform: translateX(0);
        }
      }

      @keyframes edge {
        0%,
        28% {
          opacity: 0;
        }
        31%,
        58% {
          opacity: 1;
        }
        61.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes focus-0 {
        0%,
        8% {
          opacity: 0;
        }
        9.5%,
        26% {
          opacity: 1;
        }
        28%,
        57.5% {
          opacity: 0;
        }
        59.5%,
        74% {
          opacity: 1;
        }
        75.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes path-0 {
        0%,
        26% {
          opacity: 0;
        }
        28%,
        57.5% {
          opacity: 1;
        }
        59.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes focus-1 {
        0%,
        26% {
          opacity: 0;
        }
        27.5%,
        57.5% {
          opacity: 1;
        }
        59%,
        100% {
          opacity: 0;
        }
      }

      @keyframes empty {
        0%,
        8.5% {
          opacity: 1;
        }
        10%,
        75.5% {
          opacity: 0;
        }
        78.5%,
        100% {
          opacity: 1;
        }
      }

      /* A child column grows out of its parent: its rows arrive from the
         left, 40ms apart, and leave together in 108ms. */
      @keyframes open-1 {
        0%,
        10% {
          opacity: 0;
          transform: translateX(calc(-1 * var(--_dx)));
        }
        13.5%,
        76% {
          opacity: 1;
          transform: translateX(0);
        }
        76.1%,
        100% {
          opacity: 0;
          transform: translateX(calc(-1 * var(--_dx)));
        }
      }

      /* Rows reset only once the wrapper has hidden them; the wrapper comes
         back only once they have reset. */
      @keyframes close-1 {
        0%,
        74% {
          opacity: 1;
        }
        75.5%,
        80% {
          opacity: 0;
        }
        80.1%,
        100% {
          opacity: 1;
        }
      }

      @keyframes close-2 {
        0%,
        56% {
          opacity: 1;
        }
        57.5%,
        62% {
          opacity: 0;
        }
        62.1%,
        100% {
          opacity: 1;
        }
      }

      @keyframes open-2 {
        0%,
        33% {
          opacity: 0;
          transform: translateX(calc(-1 * var(--_dx)));
        }
        36.5%,
        58% {
          opacity: 1;
          transform: translateX(0);
        }
        58.1%,
        100% {
          opacity: 0;
          transform: translateX(calc(-1 * var(--_dx)));
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The strip still has to move — the third column has nowhere else to
           be — but it moves on steps(1), on the frame the new column starts
           to fade in. Rows fade without drifting, and the cycle runs at 1.5x. */
        :root {
          --_dx: 0px;
          --_stagger: 0s;
        }

        .strip {
          animation-timing-function: steps(1, end);
        }

        .strip,
        .c2::before,
        .sel,
        .empty,
        .kids,
        .kids > * {
          animation-duration: calc(var(--t) * 1.5);
        }
      }
    </style>
  </head>
  <body>
    <div
      class="frame"
      role="img"
      aria-label="Column view of Q3 spend. Selecting a vendor opens its invoices in the next column. Selecting an invoice turns the vendor's highlight grey and shifts the columns left, leaving a sliver of the vendor column with its selection still visible, and the invoice's two payments open on the right. Going back reverses each step."
    >
      <div class="strip">
        <div class="col c0">
          <div class="cap">Vendors</div>
          <div class="row">
            Petrel Freight<span class="chev"
              ><svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
                <path
                  d="m9 5 7 7-7 7"
                  stroke="currentColor"
                  stroke-width="2.8"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                /></svg
            ></span>
          </div>
          <div class="row">
            <span class="sel s0"></span><span class="sel s0g"></span>Halden Supply<span class="chev"
              ><svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
                <path
                  d="m9 5 7 7-7 7"
                  stroke="currentColor"
                  stroke-width="2.8"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                /></svg
            ></span>
          </div>
          <div class="row">
            Marrow &amp; Co<span class="chev"
              ><svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
                <path
                  d="m9 5 7 7-7 7"
                  stroke="currentColor"
                  stroke-width="2.8"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                /></svg
            ></span>
          </div>
          <div class="row">
            Odd Lot Print<span class="chev"
              ><svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
                <path
                  d="m9 5 7 7-7 7"
                  stroke="currentColor"
                  stroke-width="2.8"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                /></svg
            ></span>
          </div>
        </div>

        <div class="col c1">
          <div class="empty">Select a vendor</div>
          <div class="kids">
            <div class="cap">Halden Supply</div>
            <div class="row">
              <span class="sel s1"></span>INV-4471<span class="amt">$5,960</span>
            </div>
            <div class="row">INV-4502<span class="amt">$6,440</span></div>
          </div>
        </div>

        <div class="col c2">
          <div class="kids">
            <div class="cap">INV-4471 · Mar 02</div>
            <div class="row dup">Paid 09:14<span class="amt">$2,980</span></div>
            <div class="row dup">Paid 09:18<span class="amt">$2,980</span></div>
            <div class="verdict">Settled twice</div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.