Rendering Modes

Home Page 2 No Svelte Page A Trello Clone An HTMX Example Rendering Modes Nested Svelte

By default, Svelte components are rendered on the server and hydrated on the client.

To render only on the client (perhaps becuase you are using a 3rd party library that uses browser globals in its initialization script, and therefor cannot be SSR'd) you can just pass in mode: "csr".

To server-render something without hyrdration, just don't call a Svelte component from your Go Templ component

*Tip: Try loading this page with Javascript disabled and compare the rendered output.

SSR Only
SSR + Hydration