Runable v1.0.0-alpha.20
Why Runable? Docs Modules Work with AI Blog About Changelog
  • 01Why Runable?
  • 02Docs
  • 03Modules
  • 04Work with AI
  • 05Blog
  • 06About
  • 07Changelog
Vue without a fixed server runtime.
Getting Started Structure Integrations Guide MCP API
  • Getting Started Structure Integrations Guide MCP API
Build the Interface
  • Routing
  • Layouts
  • Middlewares
  • Error Handling
Load and Render
  • Data Fetching
  • SSR and CSR
  • Head and SEO
Extend Runable
  • Auto-imports
  • Plugins
  • Modules
Configure and Ship
  • Runtime Configuration
  • CSS and Assets
  • Production Build
CLI
  • Overview
  • Create
  • Prepare
  • Build
  • MCP
  • AI Skills
  • Inspector

SSR and CSR

Choose the application's rendering mode and isolate browser-only code.

Runable enables server-side rendering by default. Each request creates a Vue application, resolves the route, loads awaited data, and injects generated HTML into the page.

Choose the mode

// runable.config.ts
import { defineConfig } from "runable";

export default defineConfig({
  ssr: true,
});

With ssr: false, Runable serves the client template and Vue builds the interface in the browser.

ModeChoose it for
SSRIndexable content, prefilled first render, data loaded before the response
CSRPrivate interfaces, heavy browser-API usage, no need for a rendering server

Write SSR-compatible code

window, document, localStorage, and navigator do not exist on the server. Access them after mounting:

<script setup lang="ts">
const width = ref<number>();

onMounted(() => {
  width.value = window.innerWidth;
});
</script>

Isolate a client component

<ClientOnly fallback="Loading the map…" fallback-tag="p">
  <InteractiveMap />
</ClientOnly>

You can also provide a slot:

<ClientOnly>
  <Chart />

  <template #fallback>
    <ChartSkeleton />
  </template>
</ClientOnly>

The fallback is rendered on the server. Main content appears after client mounting.

Understand hydration

During SSR, Vue takes over existing HTML instead of recreating it. The first client render must therefore produce the same structure as the server. Use ClientOnly when a library cannot meet this constraint.

Avoid unstable values during the first render

A local date, random number, or viewport measurement may differ between server and browser. Compute it after onMounted() or provide a stable initial value.

Report an issue Edit this page
Data Fetching

Load data with caching, deduplication, cancellation, and SSR hydration.

Head and SEO

Define global and page-specific HTML metadata with Unhead.

On this page

  • 1Choose the mode
  • 2Write SSR-compatible code
  • 3Isolate a client component
  • 4Understand hydration
Runable

The Vue framework that brings productive conventions to any backend.

Product

  • Why Runable
  • Documentation
  • Installation
  • Integrations

Project

  • About
  • Blog
  • Changelog
  • Sponsor

Community

  • GitHub
  • Issues
  • Discussions
  • Bluesky

© 2026 Runable. Released under the MIT License.

Open source Built with Vue and Runable