Rendering modes#
Each page picks one of three modes from its filename.
Universal (no suffix)#
The server renders the HTML, and the browser hydrates it. Use this for most pages. The page is readable without JavaScript, and interactive parts become live after the bundle loads.
app/pages/index.tsxServer (.server)#
The server renders the HTML. No client bundle is attached to the page, so the page ships no JavaScript. Use this for content pages, legal pages, and anything that needs no interactivity.
app/pages/about.server.tsxLinks from a server page are full page loads, because the client runtime is not present.
Client (.client)#
The server sends an empty shell, and the browser renders the page. Use this for dashboards and pages that depend on browser-only APIs.
app/pages/dashboard.client.tsxBrowser-only APIs such as window, localStorage, and matchMedia are safe in client pages, because they never run on the server.
Choosing a mode#
| Need | Mode |
|---|---|
| Fast first paint, SEO, and interactivity | universal |
| Static content with no interactivity | server |
| Browser-only state or APIs | client |

