Skip to content

DiffView

widgetsdisplay

DiffView: a scrollable unified diff viewer with +/- line coloring

Installation

$ bunx termuijs add diff-view

Copies the source into src/components/diff-view/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { DiffView } from '@termuijs/widgets'
ts
new DiffView(options: DiffViewOptions, style: Partial<Style> = {})

API Reference

DiffView

PropTypeRequiredDescription
linesDiffLine[]required
showLineNumbersbooleanoptional
gutterWidthnumberoptional
#display#diff-view