elm-ssrserver-rendered Elm.

Route modules render to HTML on the server.

Islands add client state only where the page needs it.

Routes

Each Elm file maps to a URL. Index.elm is the folder root, a trailing underscore marks a dynamic segment, and NotFound.elm is the fallback.

Loaders

A Loader describes what the page needs from the server — SQL, cache, fetch, env, session. The Worker runs it and resumes Elm with the decoded result.

Islands

Pages without island markers serve pure static HTML. Add an elm-ssr-island marker only where you need client state, subscriptions, or browser events.

Get started

Three commands.

Scaffold an app, build the generated router, and deploy to Cloudflare Workers.

bun elm-ssr new <name>
bun elm-ssr build
wrangler deploy
Interactive demo

The runtime in three slices.

Full architecture

Runtime pulse

Routes render HTML on the server.

SSR HTML

A route returns a Document. If that document contains no island marker, elm-ssr does not add the island script.