Skip to main content
mount() renders your app component into the #app root element. It handles both fresh rendering and hydration of server-rendered HTML.

Signature

Parameters

MountOptions

Returns

MountHandle — an object with a dispose() method to unmount the app.

Usage

Basic

With theme and styles

Root element

mount() always targets #app — there is no selector parameter. The framework controls the HTML in every context (SSR, dev server, scaffolded templates), so the root element is always <div id="app">. If #app is not found in the document, mount() throws an error.

Hydration

When server-rendered HTML exists inside #app, mount() performs tolerant hydration — it walks the existing DOM and adopts server-rendered nodes instead of replacing them. If hydration fails (mismatched structure), it falls back to full client-side rendering automatically.