Skip to content

Patterns

The record side panel

In Meadowstack a record opens from its list in a side panel first (`RecordPeek`), its id in the address, and a corner button grows it into the full record page and back. Panel and page render the same view component, so they never drift apart, and with the panel open the table hides its less important columns by its own width instead of scrolling sideways.

By Bohuslav PoláčekChecked

templates/starter/src/modules/requests/pages/request-detail.tsx
const listWithPeek = requestsPath(`?${params.preview}=${id}`);
const collapseHref = useHref(listWithPeek);
const fromPeek = (location.state as { fromPeek?: boolean } | null)?.fromPeek === true;

return (
  // The record screen fills the panel; RecordPage marks it for the morph from and to the side panel.
  <RecordPage className="flex min-h-0 flex-1 flex-col">
    <RequestRecordState
      record={record}
      variant="page"
      collapse={
        <RecordCollapseButton
          // On a phone the panel is a full-screen sheet and the top bar already leads back.
          className="max-sm:hidden"
          href={collapseHref}
          onCollapse={() => (fromPeek ? navigate(-1) : navigate(listWithPeek, { viewTransition: true }))}
        />
      }
      errorAction={
        <Button size="sm" asChild>
          <Link to={requestsPath()}>Back to purchase requests</Link>
        </Button>
      }
      onDeleted={() => navigate(requestsPath(), { replace: true })}
    />
  </RecordPage>
The starter's full record page: the same view as the side panel with the variant "page", and the corner button that collapses it back into the list it came from. Read from the repository when the site was built.

Open it in the live demo

The flow, step by step

  1. Click a row. The record slides in beside the list and its id goes into the address: ?preview=<id> in the starter, ?nahled=<id> in the demo. With room, the panel moves the page aside instead of covering it, and the list keeps its filters, scroll and selection.
  2. Click another row. The record swaps in place. Opening the panel adds one step to the browser's history and swapping replaces it, so Back leaves the panel instead of replaying every record looked at.
  3. Step through. Alt+ArrowUp and Alt+ArrowDown, or the panel's arrows, open the previous and next row in the order on screen: filtered, sorted, paged. At the ends of the list, or when a filter hid the open record, the arrows go away.
  4. Grow into the page. The corner button expands the panel into the full record page as one element morphing into another. The record stays on screen the whole time: the page opens with the copy the panel last showed while a fresh one loads, so no skeleton flashes between them.
  5. Back to the list. The page's corner button collapses it again. When the person came from the panel it steps back in history, and the list returns with its filters and scroll as they were.
  6. Share it. A link or a reload opens the same record beside the same filtered list, and the full page has an address of its own.
  7. On a phone. The record opens as a full-screen sheet with the decision first. The top bar already leads back, so the page hides its collapse button, and the table shows only its main columns with the other values folded into them (CellStack).

A list with a reading pane opens with its most interesting record already in the panel: the demo's PreselectParam (shared/preselect.tsx) writes it into the address once, and never on a phone.

The rules and where each one is enforced

What AI coding tools build instead

  • A modal for every record. It covers the list, has no address, and Back does not close it. People lose their place every time they look something up.
  • A detail page that loses the list. A click navigates away, and coming back resets the filters and the scroll, so working through twenty records is twenty round trips.
  • A separate drawer component. The drawer shows a cut-down copy of the page, written twice, and the two drift: a field added to the page never reaches the drawer. Here one view takes a variant.
  • The open record kept only in component state. A reload or a shared link shows the bare list. Here the id is in the address.
  • Columns hidden by the window's width. Media queries do not know a panel took half the screen, so the table scrolls sideways beside it. The kit's table hides its optional columns by its own width.
  • A spinner between panel and page. Expanding loads the record again and flashes a skeleton. Here the page starts from the copy the panel showed.

Where to see it

Example apps that open records beside a list

Which example apps and modules render the kit's RecordPeek, computed from the demo's code when the site was built.Read from the demo's source when the site was built: 9 of 9 example apps render <RecordPeek>, in the modules named here as each app's sidebar names them.

The panel on the list

templates/starter/src/modules/requests/pages/requests-list.tsx
const record = useRequestRecord(id, version);
const request = record.resource.status === "success" ? record.resource.data.request : null;
return (
  <RecordPeek
    open={open}
    onClose={onClose}
    title={request ? `${request.title}, ${request.number}` : "Purchase request"}
    label={request?.number}
    recordKey={id}
    // fromPeek: the page's collapse button steps back to this list as it was.
    onExpand={() => navigate(fullPage, { viewTransition: true, state: { fromPeek: true } })}
    expandHref={expandHref}
    onPrevious={onPrevious}
    onNext={onNext}
  >
    <RequestRecordState
      record={record}
      variant="peek"
      onSaved={onSaved}
      onDeleted={() => {
        onClose();
        onSaved();
      }}
    />
  </RecordPeek>
The side panel on the starter's list: the same view with the variant "peek", the expand that grows it into the page, and previous and next for stepping through the rows on screen.

Questions

Should a record open in a modal or in a side panel?

In a side panel beside its list when people move between records: the list stays in view, the address names the record, and Back and reload behave. A modal suits a short question, not a record people read and act on.

What happens to the table when the panel opens?

With room, the panel moves the page aside, and the table hides its less important columns by its own width, so it never scrolls sideways. On a phone the record opens full screen and the table folds the hidden values into its visible cells.

Can I link to a record that is open in the side panel?

Yes. The open record is in the address, so a link or a reload opens the same record beside the same filtered list. The full record page has its own address too.

When should a record not open in a side panel?

When the record is the main work, such as a long form, a diary or an editor, and in a queue people work through, where the worklist screen keeps a permanent split view.

Are the panel and the full page two components?

No. Both render the same view with a variant, so a field added to one appears in the other, and the panel morphs into the page with the record on screen in both.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app