Socket
Socket
Sign inDemoInstall

react-diff-viewer-continued

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-diff-viewer-continued

Continuation of a simple and beautiful text diff viewer component made with diff and React


Version published
Weekly downloads
173K
increased by18.25%
Maintainers
1
Weekly downloads
 
Created

What is react-diff-viewer-continued?

The react-diff-viewer-continued package is a React component library that allows you to display differences between two blocks of text. It is useful for applications that need to show changes in code, documents, or any other text-based content.

What are react-diff-viewer-continued's main functionalities?

Basic Diff Viewer

This feature allows you to display a basic side-by-side diff view of two text blocks. The `splitView` prop enables the side-by-side comparison.

import React from 'react';
import ReactDiffViewer from 'react-diff-viewer-continued';

const oldText = 'Hello World!';
const newText = 'Hello React World!';

const App = () => (
  <ReactDiffViewer oldValue={oldText} newValue={newText} splitView={true} />
);

export default App;

Inline Diff Viewer

This feature allows you to display an inline diff view of two text blocks. Setting the `splitView` prop to `false` enables the inline comparison.

import React from 'react';
import ReactDiffViewer from 'react-diff-viewer-continued';

const oldText = 'Hello World!';
const newText = 'Hello React World!';

const App = () => (
  <ReactDiffViewer oldValue={oldText} newValue={newText} splitView={false} />
);

export default App;

Customizing Diff Colors

This feature allows you to customize the colors used in the diff viewer. You can provide a `styles` prop with custom styles to change the background colors for added and removed lines.

import React from 'react';
import ReactDiffViewer from 'react-diff-viewer-continued';

const oldText = 'Hello World!';
const newText = 'Hello React World!';

const customStyles = {
  variables: {
    light: {
      diffViewerBackground: '#f8f8f8',
      addedBackground: '#e6ffed',
      removedBackground: '#ffeef0',
    },
  },
};

const App = () => (
  <ReactDiffViewer oldValue={oldText} newValue={newText} splitView={true} styles={customStyles} />
);

export default App;

Other packages similar to react-diff-viewer-continued

Keywords

FAQs

Package last updated on 17 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc