component-design
Installation
SKILL.md
Component Design (Next.js)
Guiding principles for designing React components in Next.js App Router — focusing on API surface, composition, and the Server/Client boundary.
Core Principles
1. Server Component by Default
Prefer Server Components unless you need interactivity (hooks, event handlers, browser APIs). Every component that can be a Server Component should be one.
app/page.tsx → Server Component (data fetching, layout)
app/page.tsx → Client Component only if interactive
components/button.tsx → Client Component (has state/events)
2. Push Client Boundaries Down
When you need a Client Component, make it as thin as possible. Wrap the interactive part in a Client boundary and keep everything else on the server.