Dev Helpers
← Back

Activity rail slot

Place this file at app/dashboard/layout.tsx in an App Router project. Supply app/dashboard/@activity/page.tsx and a default.tsx fallback for hard reloads.

Open this example in the interactive library

Source code

// app/dashboard/layout.tsx

import type { ReactNode } from "react";

export default function ActivityRailSlot({
  children,
  activity,
}: {
  children: ReactNode;
  activity: ReactNode;
}) {
  return (
    <div style={{ display: "flex", flexWrap: "wrap", gap: "1rem" }}>
      <main style={{ flex: "3 1 22rem" }}>{children}</main>
      <aside aria-label="Activity" style={{ flex: "1 1 12rem" }}>
        {activity}
      </aside>
    </div>
  );
}