Quick reference · Print-friendly

Server Components field guide

Classify capabilities, cut the module graph, minimize the wire.

3 artifactsHTML · RSC payload · client JS

Capability matrix

CapabilityServer ComponentClient Component
Direct database/filesystem accessYes, when the server environment provides itNo; use a server API or Server Function
Async component with awaited dataYesReceive data, promises, or fetch through client mechanisms
State and event handlersNoYes
Effects and browser APIsNoYes
Source shipped in client bundleNoYes, with transitive client dependencies
Can contribute to initial HTMLYesYes, in frameworks that prerender/SSR them
Props crossing server → clientProduces supported serialized values/elementsReceives them over the RSC boundary
Context consumptionCannot consume client contextYes; place provider as deep as practical

Boundary placement algorithm

  1. Mark components requiring state, effects, handlers, context, or browser APIs.
  2. Create client entry points at the smallest cohesive interactive roots.
  3. Trace every transitive import below each entry point; that is the actual client graph.
  4. Keep database clients, secrets, heavy transforms, and server-only libraries above the cut.
  5. Pass narrow supported serialized values—not service objects, closures, or whole records by habit.
  6. For visual nesting, compose Server Components in a server parent and pass them into client slots.
  7. Parallelize independent server reads and add Suspense where latency and fallback independence justify it.
  8. Measure client modules, RSC payload, server latency, hydration, caching, and navigation—not bundle size alone.

Know what crosses

Rendered output

Server result

The browser does not receive Server Component source or its server-only dependencies.

References

Client holes

The payload identifies where Client Components belong and which client modules implement them.

Values

Boundary props

Supported serialized props become observable client data. Treat the boundary like an API.

Correct the premise

“RSC versus SSR?”

Execution/payload partition versus initial HTML generation. They compose.

“Server means per request?”

No. Server Components can run during a build or on a live server.

“Client means browser-only HTML?”

No. Client code ships and hydrates, but may also participate in initial server HTML.

'use server' component?”

No. It marks a callable async Server Function; Server Components have no directive.