Dev Helpers

Next.js / Parallel route slots

Collapsible activity slot

Dev Helpers · September 11, 2025

A collapsible activity slot separates secondary content from the main route. Choose whether its open state should persist between sibling pages.

Worked example

// app/dashboard/layout.tsx

import type { ReactNode } from "react";

export default function CollapsibleActivitySlot({
  children,
  activity,
}: {
  children: ReactNode;
  activity: ReactNode;
}) {
  return (
    <main>
      {children}
      <details>
        <summary>Recent activity</summary>
        {activity}
      </details>
    </main>
  );
}

Implementation notes

Loading a secondary slot should not block essential primary content unnecessarily. Place boundaries around the portion that can resolve independently.

Try it yourself

Expand the slot, change routes and return using the back button.

Open the Next.js example →

Editorial date September 11, 2025 · Published December 6, 2026

Related articles

Free bin volume

Free storage volume depends on consistent dimensions and units. Derive capacity and usage in the same unit before formatting a human-readable summary.

Draft preview indexing

Draft pages need deliberate indexing metadata. An indexing directive controls crawler intent, while access to unpublished material needs a separate permission check.

Party size allocation

Allocating a party into groups is an integer problem. The remainder determines whether another group is needed and how full it will be.