Components
DiffView
Unified diff viewer with add/remove highlighting — LCS algorithm, no external deps.
Display text diffs with colored additions and deletions. Uses a built-in LCS-based diff algorithm with no external dependencies.
Installation
Usage
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
before | string | — | Original text (required) |
after | string | — | Modified text (required) |
mode | 'unified' | 'split' | 'unified' | Display mode |
showLineNumbers | boolean | true | Show line numbers |
contextLines | number | 3 | Unchanged lines around changes |
maxHeight | number | — | Max visible rows |
beforeLabel | string | 'Before' | Label for original |
afterLabel | string | 'After' | Label for modified |
showBorder | boolean | true | Show rounded border |
theme | InkUITheme | darkTheme | Color theme |