DiffViewer
Data

DiffViewer.

Readable inline or split code differences with added and removed lines.

Real interactive component
Live demo
Code changes−2 / +3
1−const theme = "dark";
2−const radius = 8;
1+const theme = "light";
2+const radius = 16;
33 console.log(theme);
4+export { theme };

The preview uses the actual shared component, including your current theme, rounding, border and motion preferences.

Props & API reference

Parameters available in the shared component, including value types, requirements and accepted options.

5 props
ParameterTypeRequiredDefaultPossible valuesDescription
beforestringYes——Original text to compare.
afterstringYes——Updated text to compare.
view"inline" | "split"Noinlineinline · splitDisplay removed/added lines together or in two panes.
labelstringNoCode changes—Accessible diff region label.
classNamestringNo——Additional CSS class on the outer component element.