View Transitions
Add <ViewTransitions /> to a shared layout to animate full-page navigations via the browser's cross-document View Transitions API — no client router. The card animates while the video below is held still and keeps playing across the navigation, resuming at the same timestamp.
Page 2
Each navigation is a full page load — the browser animates it with a scale transition.
<script lang="ts">
import { url } from 'mochi-framework';
import { ViewTransitions } from 'mochi-framework/components';
import TransitionCard from './TransitionCard.svelte';
const type = parseTransition(url.searchParams.get('type'));
</script>
<ViewTransitions {type} regions="card" />
<TransitionCard page={1} {type} />
More demos
Isomorphic URL One import for the current URL — reads from the request on the server, window.location on the client. Server Props Define serverProps on Mochi.page() to pass fresh data into a Svelte page on every request. MdSvex A .md file compiled through mdsvex and rendered as a Svelte component, with an embedded <script> block.