Code diff

Shows what changed from original to value: removed and added lines and the changed characters inside them, inline or side by side. It scrolls to the first change and can let people edit the new side. The diff is computed by the kit, with no library.

Part of @tectra-ng/code-editor — install it separately: npm install @tectra-ng/code-editor.

Features4APIThemingAccessibility

Basic

Inline view: removed lines in red above the added lines in green, changed characters marked inside. Whitespace at the start and end of a line is ignored by default (ignoreTrimWhitespace).

Side by side

view="split" puts the original on the left and the new text on the right; empty rows keep the lines aligned and both sides scroll together.

Editable

Without readOnly the new side is an editor: [(value)] follows the edits and the diff updates as you type. changed reports the added and removed line counts.

+3−2