FIG-001 · MASTHEAD

svelte/virtual chat.

The Svelte 5 chat component that keeps long conversations stable while LLM responses stream and older history loads. Get chat-aware follow-bottom, in-frame height correction, anchored prepends, and message identity with only the visible messages in the DOM.

get started ↗ api reference examples
FIG-001
SHEET 01 / 06
dom nodes
~20
at 10,000 messages
messages
10k+
still smooth
tarball
40.2kB
packed (npm gz)
dependencies
1
micro dep · esm-env
streaming
1frame
correction, before paint
licence
MIT
on GitHub
FIG-002 / STREAMING

stream ai responses in real-time.

A live SvelteVirtualChat instance. Assistant replies stream in token-by-token while the viewport stays pinned to bottom — corrected in the same frame the height grows, before paint.

file · live-chat.svelte dom —/0 tokens 0/— ○ IDLE
FIG-003 / CAPABILITIES

built for chat, not lists.

Generic virtualizers render rows. VirtualChat also owns the conversation behavior: following, streaming growth, history anchoring, and message identity.

№ 01 / 06

Follow-Bottom

Stay with new messages and streaming replies until the reader scrolls away. Return to the bottom and following resumes.

№ 02 / 06

Frame-Stable Streaming

Correct token-by-token height growth in the same frame, before paint. No jitter, jumps, or manual scroll fixes.

№ 03 / 06

Virtualized

Only visible messages exist in the DOM. 10,000 messages renders ~20 DOM nodes.

№ 04 / 06

Anchored History

Prepend older messages without moving the conversation. The reader's visible message and offset stay anchored.

№ 05 / 06

Message Identity

Track messages by getMessageId instead of array position, with keyed rendering, height caching, and scroll-to-message built in.

№ 06 / 06

Svelte 5 + TypeScript

Full generics, runes ($state, $derived, $effect), and snippets. One micro-dependency (esm-env).

FIG-004 / PLAYGROUND

live playground.

Type a message and send it. Watch follow-bottom re-engage and the virtualization stats update as the conversation grows.

file · playground.svelte messages 1 dom —/0 ● FOLLOWING
assistant
Welcome! Type a message below and watch follow-bottom and the virtualization stats react in real time.
// virtualization
total 1
in dom
measured
range
follow bottom
FIG-005 / AI-READY

built for ai-assisted code.

Point Cursor, Claude Code, or any LLM at the manifests below and they know the full svelte-virtual-chat API — every prop, the debug-info schema, follow-bottom and streaming semantics, and history-prepend anchoring.

FIG-006 / EXAMPLES

explore interactive examples.

See basic chat, LLM streaming, history loading, and persistent header / footer snippets — all self-contained live demos with copyable source.

view all examples →
SET / JETBRAINS MONO + INTER
HUMANSPEAK · 2026
MIT LICENCE
● 0.1.23
SHEET 06 / 06
END OF DOCUMENT
↩ TO TOP