DiffViewer
Data Display

DiffViewer

Read-only unified diff pane with add/remove tinting and line numbers.

Props

DiffLine fields: type ("add" | "del" | "ctx" | "hunk"), content, oldNo?, newNo?.

DiffViewerProps props
PropTypeDefaultDescription
diffstring—Unified diff text, parsed internally. Takes precedence over lines.
linesDiffLine[]—Pre-parsed diff lines array.
noGutterboolean—Hide the old/new line-number gutters.

Examples

Unified diff
No gutter
ImportTSX
import { DiffViewer, parseUnifiedDiff } from "@solarius/onset";
import type { DiffLine } from "@solarius/onset";