AloftWorkBlog

Can Layouts be Client Components in Next.js?

Last modified: 16 July, 2025

nextjs server components client components react rsc

In short yes, nextjs layout components can be client components. Next's layout and page components are nothing but react components. So they follow all the rules of react components.

Caveats

As next's layout and page components are nothing but react components, all the rules for RSC apply to them as well. One of them, that you should keep in mind is: children of client components can be server components. They are not magically made client components. If you include a "use client" directive in a layout.tsx file, the layout component will become a client component. But it does not mean all its children will be client component as well.

Implications

Although, it is possible to make layout components (including the root layout component), a client component, it makes little sense to do it. Some of the implication are listed below.

  • You can't perform data fetching inside react.
  • It will increase javascript bundle size.
  • You cannot access server-only APIs (like cookies() or headers() from next/headers) directly. You can't export metadata or generateMetadata() either.

FAQs

Can layouts be server components?

Layouts are server components by default. Next's layout components are nothing but react components and they follow all the rules of react components. All components are server components unless you explicitly add a "use client" directive. If you provide the "use client", then, the component becomes a client component.

Can Layouts be Client Components in Next.js?