svelte/diff.
Readable, reactive text diffs for Svelte 5. Semantic cleanup, expected-pattern matching, typed snippets, CSS classes, and processing telemetry in one focused component.
edit the comparison.
Change either document. SvelteDiff reacts immediately, applies semantic cleanup, and reports the work it performed.
open full example ↗The documentation will ship afterwith the launch.
Owner: Product EngineeringDeveloper Experience
why svelte-diff.
A compact API with deliberate escape hatches for styling, markup, and telemetry.
Reactive text comparison
Pass before and after strings. The rendered diff recomputes whenever either prop changes.
Semantic cleanup
Move edit boundaries toward changes a person can scan instead of raw character noise.
Expected patterns
Mark dates, versions, names, and generated values with named capture groups.
Svelte 5 snippets
Own removed, inserted, equal, expected, and line-break markup independently.
Class-based styling
Keep the default spans and apply semantic classes when full custom rendering is unnecessary.
Processing telemetry
Inspect core, cleanup, and total timing alongside the raw diff tuples.
built for ai-assisted code.
Point Cursor, Claude Code, or any LLM at the manifests below and it gets the complete SvelteDiff contract: cleanup precedence, expected patterns, renderer snippets, callback types, and runnable examples.
/llms.txt
Compact discovery map with the install command, important behavior, canonical documentation links, and every example mirror.
/llms-full.txt
One-file reference containing the complete API, guides, migration notes, expected-pattern semantics, and performance guidance.
/docs/<slug>.md
Every guide mirrored as clean Markdown, plus runnable Svelte source under /examples/<slug>.md for agents that need implementation detail.
Use https://diff.svelte.page/llms.txt as the source for @humanspeak/svelte-diff. Build a Svelte 5 review panel that compares
two editable documents, enables semantic cleanup, styles insertions and
removals, and reports onProcessing timing.