DiffViewer
v1.0.1NewUpdated 18 Jul 2026Dependency-free text diff viewer: line-level Myers (linear space) with word-level refinement inside changed line pairs. Unified (inline) and side-by-side (split) modes, collapsible unchanged context with keyboard-operabl
Preview
Live · 12 stories▸Why this is recommendeddiffcompareauditversioning+4
DiffViewer — inline.
- ✓Quotation / invoice revision review
- ✓Audit-log detail panes
- ✓Draft vs published content comparison
- ✓Config or template change approval
- Myers linear-space line diff with word-level refinement
- Inline (unified) and split (side-by-side) modes
- Context folding with expandable unchanged-run separators
- Controlled + uncontrolled fold expansion
- Line numbers, +/- markers, added/removed counts
- Focusable labelled scroll region (maxHeight)
- Input capped at 20,000 lines per side with truncation notice
- FieldDiff companion for audit-log field changes
- Added/removed surfaces from success/danger soft tokens only
- i18n: shared labels prop on DiffViewer + FieldDiff overrides every built-in string; line counts format via LocaleProvider (DEFAULT_DIFF_VIEWER_LABELS)
- ✕Rich-text visual diffing (renders plain text)
- ✕Binary or image comparison
- ✕Editing content (read-only display)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
oldValueOriginal text
yesnewValueUpdated text
yesmodeUnified or side-by-side layout
—oldLabelHeader label for the original side
—newLabelHeader label for the updated side
—contextUnchanged lines kept around changes; longer runs fold
—showLineNumbersShow line-number gutters
—maxHeightMax height of the scrollable diff area
—sizeTypography scale
—expandedFoldsControlled expanded fold ids
—onExpandedFoldsChangeFold expansion callback
—labelsOverride built-in UI strings of DiffViewer AND FieldDiff (fold rows, truncation notice, region labels, sr line prefixes, FieldDiff headers/status badges/not set) for i18n; English defaults exported as DEFAULT_DIFF_VIEWER_LABELS. Counts format via LocaleProvider
—