# Static Rendering

Static rendering is the default for Neutron routes. It is intended for pages
whose output can be known at build time.

## Build process

For each static route, `neutron-ts build`:

1. Loads the matching layouts and page.
2. Runs their loaders, if present.
3. Renders the component tree to HTML.
4. Writes the HTML and links it to the built stylesheet assets.

Dynamic routes are generated once for every parameter set returned by
`getStaticPaths`.

## Client JavaScript

A plain static page does not receive Neutron's client router or page-shell
hydration. Static pages can still contain authored scripts, native browser
features such as view transitions, and independently hydrated
[islands](/docs/rendering/islands).

This distinction matters: `static` describes when the page HTML is produced,
not a blanket prohibition on JavaScript.

## Build-time data

Static loaders run during the build:

```tsx
import { useLoaderData } from "@neutron-build/core";

export async function loader() {
  return { posts: await listPublishedPosts() };
}

export default function Posts() {
  const { posts } = useLoaderData<typeof loader>();
  return <PostList posts={posts} />;
}
```

Rebuild to publish changes in that data. If the response must vary by user or
request, use [server-rendered app mode](/docs/rendering/server-side-rendering).
