nextjs-client-boundary

Guide 'use client' placement in Next.js server and client components.

2|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/yutna/vibe-next-template --skill nextjs-client-boundary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-client-boundary
Source: https://github.com/yutna/vibe-next-template/tree/main/.claude/skills/nextjs-client-boundary
Command: npx skills add https://github.com/yutna/vibe-next-template --skill nextjs-client-boundary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides when to apply "use client" directives in Next.js components to control client boundaries and optimize server rendering.

Core Features & Use Cases

  • Server-first guidance: default to server components and add "use client" only when necessary.
  • Boundary-placement strategies: push interactive parts to the leaves to minimize client footprint.
  • Reference conventions: aligns with CLAUDE workflow conventions for consistency.

Quick Start

Determine where to place "use client" in your Next.js components using the rules and boundary strategies described above.

Frequently Asked Questions about nextjs-client-boundary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When do I need to use client boundaries in Next.js server components?

You need to use client boundaries in Next.js when a component requires interactivity, state, or browser APIs. Apply the "use client" directive only to those specific leaf components, keeping the rest of your app server-rendered by default.

How do I decide where to place the use client directive in Next.js layouts and pages?

To place the "use client" directive in Next.js, push interactive parts to the leaves of your component tree. Keep layouts and pages as server components, and insert the directive only at the lowest-level interactive widgets to minimize client footprint.

What is the difference between server components and client components in Next.js?

Server components render on the server for optimized performance, while client components render on the browser to handle interactivity. The "use client" directive establishes the boundary, trading server-side benefits for client-side state and event handling.

Can I use client components within a server-first Next.js architecture?

Yes, you can use client components within a server-first architecture. Default to server components for pages and layouts, then selectively import client components for interactive widgets, ensuring the boundary is placed at the lowest necessary level.

What are the limitations of marking an entire Next.js page as a client component?

Marking an entire Next.js page as a client component increases the client JavaScript bundle and reduces server-rendering benefits. To avoid this limitation, keep the boundary at the leaf level and isolate interactive widgets from server-rendered layouts.

What is the best way to minimize client bundle size when using React server components?

The best way to minimize client bundle size with React server components is to push the "use client" boundary to the deepest leaf components. Isolate interactive widgets so that pages and layouts remain server-rendered and only necessary code ships to the browser.