layout.js

A layout is UI that is shared between routes.

app/dashboard/layout.tsx
export default function DashboardLayout({ children }: {
  children: React.ReactNode
}) {
  return <section>{children}</section>;
}
  • children: (required) React component containing the route segments the layout is wrapping.
  • params: (optional) The dynamic route parameters object from the root segment down to that layout.

Next Steps