Real-time Chat
An example of building a simple in-memory chat using a hydrated island and the built-in WebSocket support in Bun. The server stores message history and replays it to new connections; ws.publish() broadcasts each message to all clients. Open this page in two tabs to see them sync in real time.
Chat
<script>
import ChatWidget from './ChatWidget.svelte';
import { files } from './files.ts';
const sources = await loadSources(files);
</script>
<ChatWidget mochi:hydrate />
More demos
Custom Transitions Bring your own @keyframes to <ViewTransitions /> via custom={{ in, out }} — here, a funky 3D spin. View Transitions Drop <ViewTransitions /> into a shared layout to animate full-page navigations with zero JavaScript. Isomorphic URL One import for the current URL — reads from the request on the server, window.location on the client.