Skip to main content

Diff Viewer

Show a change between two texts, unified or side by side, with changed words marked.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
beforestring-The text before the change.
The text before the change.
afterstring-The text after it.
The text after it.
filenamestring-The file's name in the header.
The file's name in the header.
defaultViewunified | splitunifiedOne column with removed lines over added ones, or the two sides next to each other.
One column with removed lines over added ones, or the two sides next to each other.
contextnumber2Unchanged lines kept around each change; longer runs fold behind a button.
Unchanged lines kept around each change; longer runs fold behind a button.
shapenone | rounded | pillrounded
classNamestring-
focusboolean | stringtrue