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