Real-time Streams
You can build a WebSocket clock and a Server-Sent Events clock side by side, ticking every second. The component hydrates only when scrolled into view via mochi:hydrate:visible with a 100px rootMargin.
WebSocket connecting
--:--:-- /ws/timeSSE connecting
--:--:-- /sse/time$props.id(): s1
<script>
import RealtimeClocks from './RealtimeClocks.svelte';
import { files } from './files.ts';
const sources = await loadSources(files);
</script>
<RealtimeClocks mochi:hydrate />
More demos
Captcha How the captcha works — slide-to-verify backed by a hash chain and proof-of-work, with no third party and no tracking. Shared Props How island prop deduplication works — nine islands share three unique payloads, each serialized once and referenced via props-ref. Tailwind Todo App Classic todo app styled with Tailwind CSS.