Try either "react-diff-view" or "react-diff-viewer".

The "react-diff-viewer" is quite simple to use/implement while the "react-diff-view" offers some more advanced features.

It's up to you, here the links: https://www.npmjs.com/package/react-diff-viewer https://www.npmjs.com/package/react-diff-view

Answer from Jamil Mammri on Stack Overflow
🌐
GitHub
github.com › praneshr › react-diff-viewer
GitHub - praneshr/react-diff-viewer: A simple and beautiful text diff viewer component made with Diff and React.
A simple and beautiful text diff viewer component made with Diff and React. Inspired from Github diff viewer, it includes features like split view, inline view, word diff, line highlight and more.
Starred by 1.6K users
Forked by 309 users
Languages   TypeScript 96.3% | JavaScript 3.1% | Shell 0.6% | TypeScript 96.3% | JavaScript 3.1% | Shell 0.6%
🌐
npm Trends
npmtrends.com › react-diff-components-vs-react-diff-view-vs-react-diff-viewer
react-diff-components vs react-diff-view vs react-diff-viewer | npm trends
Comparing trends for react-diff-components 0.0.4 which has 59 weekly downloads and 2 GitHub stars vs. react-diff-view 3.3.2 which has 215,347 weekly downloads and 988 GitHub stars vs. react-diff-viewer 3.1.1 which has 269,648 weekly downloads and 1,642 GitHub stars.
🌐
NPM Compare
npm-compare.com › react-diff-view,react-diff-viewer
react-diff-viewer vs react-diff-view | React Diff Libraries
It is particularly useful for applications where performance is a concern and where you want to minimize the overhead of additional features. ... react-diff-viewer is a React component that allows developers to easily display differences between two pieces of text or code.
🌐
npm
npmjs.com › package › react-diff-view
react-diff-view - npm
July 24, 2025 - A git diff component to consume the git unified diff output.. Latest version: 3.3.2, last published: 8 months ago. Start using react-diff-view in your project by running `npm i react-diff-view`. There are 52 other projects in the npm registry using react-diff-view.
      » npm install react-diff-view
    
Published   Jul 24, 2025
Version   3.3.2
Author   otakustay
🌐
NPM Compare
npm-compare.com › react-diff-view,react-diff-viewer,react-diff-viewer-continued
react-diff-viewer-continued vs react-diff-viewer vs react-diff-view | React Diff Viewer Libraries
This library also provides a way ... features and customization options. react-diff-viewer is built on top of react-diff, and it offers a more refined interface with the ability to display diffs in a side-by-side or inline format....
🌐
npm
npmjs.com › package › react-diff-viewer
react-diff-viewer - npm
May 22, 2020 - A simple and beautiful text diff viewer component made with Diff and React. Inspired from Github diff viewer, it includes features like split view, inline view, word diff, line highlight and more.
      » npm install react-diff-viewer
    
Published   May 22, 2020
Version   3.1.1
Author   Pranesh Ravi
🌐
DhiWise
dhiwise.com › post › exploring-the-power-of-react-diff-viewer-comprehensive-guide
Exploring the Benefits of React Diff Viewer for Code Comparison
February 15, 2024 - React Diff Viewer is designed to render differences between two pieces of code or text, highlighting the changes visually appealingly. It supports unified and split views, allowing developers to choose their preferred way of displaying diffs.
Find elsewhere
🌐
Mrwangjusttodo
mrwangjusttodo.github.io › git-diff-view
Git Diff View - High-Performance Diff Component for React, Vue, Solid & Svelte
A feature-rich, high-performance diff view component for React, Vue, Solid, and Svelte. GitHub-style UI with syntax highlighting, split/unified views, and SSR support.
🌐
UNPKG
unpkg.com › browse › react-diff-viewer@3.1.0 › README.md
react-diff-viewer
| | splitView | `boolean` | `true` | Switch between `unified` and `split` view. | | disableWordDiff | `boolean` | `false` | Show and hide word diff in a diff line. | | compareMethod | `DiffMethod` | `DiffMethod.CHARS` | JsDiff text diff method used for diffing strings. Check out the [guide](https://github.com/praneshr/react-diff-viewer/tree/v3.0.0#text-block-diff-comparison) to use different methods.
🌐
CodeSandbox
codesandbox.io › examples › package › react-diff-viewer
react-diff-viewer examples - CodeSandbox
AboutA simple and beautiful text diff viewer component made with diff and React202,512Weekly Downloads
🌐
npm Trends
npmtrends.com › react-diff-view-vs-react-diff-viewer
react-diff-view vs react-diff-viewer | npm trends
Comparing trends for react-diff-view 3.3.2 which has 147,578 weekly downloads and 972 GitHub stars vs. react-diff-viewer 3.1.1 which has 235,104 weekly downloads and 1,617 GitHub stars.
🌐
NPM Compare
npm-compare.com › deep-diff,diff,diff-match-patch,diff2html,react-diff-view
diff vs diff-match-patch vs deep-diff vs diff2html vs react-diff-view | JavaScript Diff Libraries
This library also provides a way ... features and customization options. react-diff-viewer is built on top of react-diff, and it offers a more refined interface with the ability to display diffs in a side-by-side or inline format....
🌐
LinkedIn
linkedin.com › pulse › react-diff-viewer-imen-benmohamed
React Diff Viewer
September 5, 2023 - The unified view displays the entire content with changes, while the split view visually separates the two sets of data for easier comparison. Word and Character Diffs: It can show word-level and character-level differences, depending on your needs.
🌐
Kyle-peacock
kyle-peacock.com › blog › react-diff
React Diff Viewer | Kai Peacock's website
May 23, 2020 - Technical and non-technical posts from Kai's blog. This blog is a bit of a digital garden.
🌐
GitHub
github.com › otakustay › react-diff-view
GitHub - otakustay/react-diff-view: A git diff component · GitHub
A widget is any react element bound to a change object, a widget is configured in an object with change and element property, when rendering diff changes, if there is a widget object with the same change object, the element will be rendered below the line of code. In split view a widget will be rendered to its corresponding side if change object is of type addition or deletion, otherwise the widget will be rendered across the entire row.
Starred by 988 users
Forked by 89 users
Languages   TypeScript 92.9% | Less 3.7% | CSS 2.1% | JavaScript 1.1% | Shell 0.2%
🌐
CodeSandbox
codesandbox.io › examples › package › react-diff-view
react-diff-view examples - CodeSandbox
Use this online react-diff-view playground to view and fork react-diff-view example apps and templates on CodeSandbox.
🌐
Snyk
snyk.io › advisor › react-diff-view › react-diff-view code examples
Top 5 react-diff-view Code Examples | Snyk
mozilla / addons-code-manager / src / utils.spec.tsx View on Github · it('returns a flattened list of all changes', () => { const diff = parseDiff(diffWithDeletions)[0]; const changes = getAllHunkChanges(diff.hunks); // Check a line from the first hunk: expect(changes.filter((c) => c.lineNumber === 2)[0].content).toEqual( "import { Diff, DiffProps, parseDiff } from 'react-diff-view';", ); // Check a line from the second hunk: expect(changes.filter((c) => c.lineNumber === 24)[0].content).toEqual( ' console.log({ hunk });', ); // Check a line from the third hunk: expect(changes.filter((c) => c.lineNumber === 50)[0].content).toEqual( ' ', ); }); });
🌐
Npm
npm.io › search › keyword:diff-viewer
Diff-viewer | npm.io
A simple and beautiful text diff viewer component made with diff and React