nextjs-client-components

Create interactive Next.js App Router Client Components with the "use client" directive.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill nextjs-client-components-juandiego30
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-client-components
Source: https://github.com/JuanDiego30/cermont_aplicativo/tree/main/.agents/skills/nextjs-client-components
Command: npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill nextjs-client-components-juandiego30

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline the creation of interactive client-side elements in Next.js App Router by providing clear patterns, conventions, and best practices for Client Components.

Core Features & Use Cases

  • Client-driven UI patterns for stateful components, effects, and browser APIs (window, localStorage).
  • Clear guidance on placing the "use client" directive and composing Client Components with Server Components.
  • Best practices for performance, accessibility, and maintainability in client-side interactivity.

Quick Start

Create a small interactive component with "use client" at the top, add a simple local state, and export it for use in a Server Component.

Frequently Asked Questions about nextjs-client-components

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

FAQPage Schema
How do I use the "use client" directive in Next.js App Router?

To use the "use client" directive in Next.js, place it at the top of your component file before any imports. This marks the file as a Client Component, enabling client-side rendering, stateful UI, and browser API access.

How do I build interactive Next.js Client Components with browser APIs?

Build interactive Next.js Client Components with browser APIs by adding the "use client" directive. This allows your component to safely access window, localStorage, and other browser APIs while maintaining stateful UI and effects.

Can I pass non-serializable props to Next.js Client Components?

You cannot pass non-serializable props to Next.js Client Components. When composing Client Components with Server Components, you must ensure all props passed from server to client are strictly serializable to prevent rendering errors.

What is the best way to coordinate Next.js Server and Client Components?

The best way to coordinate Next.js Server and Client Components is by composing them modularly. Keep Server Components for data fetching and pass serializable props to Client Components to handle stateful UI, forms, and animations.

Why does my Next.js Client Component throw a server-only code error?

Next.js Client Components throw server-only code errors when they contain backend logic or non-serializable functions. You must strictly avoid server-only code within Client Components and ensure only client-safe interactivity and hook patterns are used.