# Server rendering and RSC

Request-local configuration, stable initial markup, streaming assets and explicit client boundaries.

## SSR application
The server-rendered documentation edition uses Next.js App Router. Document prose is rendered on the server for each request. Interactive examples remain Client Components. The server resolves the route-specific example before rendering the article, so its controls are visible in the initial HTML and hydrate in place without a streamed loading swap. Server HTML is not replaced by a static screenshot.

Request-known preferences initialize the provider. The head bootstrap resolves browser-local preference before visible content. Its inline script requires an appropriate CSP nonce or exact hash authorization in a restricted deployment.

## Server Component boundaries
Static typography, layout and surface primitives do not need a client provider to execute. Behavioral defaults needed during server execution must be explicit or build-bound. Client context cannot configure server execution retroactively.

## Optional runtime styles
`@fayegram-ai/faye-ui/nextjs` connects a request-local streaming collector with useServerInsertedHTML and a deferred client registry. Precompiled CSS does not require this adapter.

A streaming response cannot retroactively reorder previously flushed CSS. Late rules that would precede already-emitted rules are rejected. Precollect those sheets or assign an order compatible with stream arrival.

## Verification status
SSR, streaming, React Server Components and optional framework adapters require integration testing in the consuming application. Match client/server boundaries, initial state and stylesheet delivery. See [verification](/docs/verification/) for package status and review limits.

## Matching first-paint scope settings
ThemeScript accepts serverScheme, axes and motion in addition to color preference, density and direction. Match serverScheme to the provider's initial snapshot; it is used when system media access is unavailable. A stored explicit light/dark preference and a readable system preference still take precedence.

Omitting axes or motion preserves server-authored attributes for backward compatibility. Passing axes replaces the named-axis selection, including removal of stale attributes; an explicit empty map resets it. motion="system" removes an explicit reduced-motion attribute, while motion="reduced" installs it. The browser's own reduced-motion preference continues to apply through CSS.

These first-paint helpers do not change React's hydration contract. Static markup, IDs and logical initial values must still agree between server and client. Test the actual server/client integration used by your application.
