Cookies
You can read incoming cookies during SSR and write them back via Set-Cookie through the Mochi cookies API exposed on both server and client.
<script>
import CookieDemo from './CookieDemo.svelte';
import { files } from './files.ts';
const cuteNames = ['mochi_fan', 'bun_bun', 'pixel_panda', 'tiny_tanuki', 'cloud_kitten', 'waffle_fox', 'cocoa_bear', 'starry_otter', 'maple_duck', 'peach_pup'];
const randomCuteName = cuteNames[Math.floor(Math.random() * cuteNames.length)];
const sources = await loadSources(files);
</script>
<CookieDemo defaultUsername={randomCuteName} mochi:hydrate />
More demos
Hydratable Compute a value once on the server with hydratable(); the hydrated island reads it from <head> instead of re-running the async work. View Transitions Drop <ViewTransitions /> into a shared layout to animate full-page navigations with zero JavaScript. File Uploads via form actions multipart/form-data submission, validated with fail() and success(), shown enhanced and plain.