FIG-001 · MASTHEAD

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.

get started ↗ examples api reference compare
FIG-001
SHEET 01 / 06
component
1
drop-in svelte
segment types
4
remove / insert / equal / expected
cleanup modes
3
raw / efficiency / semantic
timeout
1s
configurable default
tarball
28.1kB
packed from npm
licence
MIT
open source
FIG-002 / LIVE DIFF

Compare two strings in Svelte.

Use this Svelte diff viewer to highlight insertions and deletions inline. Pass your before and after strings as originalText and modifiedText; the diff updates whenever either value changes. Choose character, word, or line comparison. Character uses semantic cleanup.

Comparing timestamps, versions, or generated IDs? Use expected patterns to keep intentional changes visible without treating them as ordinary edits.

build your own Svelte diff viewer ↗ choose a diff mode ↗ word example ↗ line example ↗
file · homepage-diff.svelte main 0.00ms cleanup 0.00ms segments 0 ● LIVE
Diff mode
OUT / CHARACTER DIFF · semantic cleanup total · 0.00ms
Release v1.82.0.0 is ready for final review.
The documentation will ship afterwith the launch.
Owner: Product EngineeringDeveloper Experience
FIG-003 / CAPABILITIES

why svelte-diff.

A compact API with deliberate escape hatches for styling, markup, and telemetry.

FIG-004 / COMPARE

Choose your diff tool.

Find the right tool for comparing strings in Svelte, computing diff data, or displaying git patches. Explore the features and tradeoffs of each option.

all comparisons ↗
FIG-005 / AI-READY

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.