DiffView

Two versions in one column: removed lines on red, added on green, changed words marked, unchanged runs folded.

View source
Before → after2 lines added, 2 removed
  "projects": [    {      "avatar_url": null,Removed       "id": "proj_01m5m8f0beeb8vqk4x6852hbcv",Removed       "name": "Checkout"Added       "id": "proj_01m5p292xvef2v2ss387kgrvt2",Added       "name": "Agents"    }  ],  "provider": "xai",
import { DiffView } from "@logicplanes/kaeso-ui";

Props

  • after
    string

    The new version.

  • before
    string

    The old version.

  • context
    number = 3

    Unchanged lines kept around each change before the rest folds (3 by default).

  • copy
    boolean = true

    Hide the copy circle, which copies the diff with + and - markers.

  • lang
    CodeLang = text

    The language of both versions to highlight (text by default). resolveCodeLang turns a fence name such as py or sh into one.

  • lineNumbers
    boolean

    Shows the old and the new line numbers.

  • surface
    "well" | "plain" = well

    On a flat plate (well) or on the panel itself (plain).

  • title
    ReactNode

    A name in the title bar, beside the count of added and removed lines.

  • wrap
    boolean = false

    Long lines wrap instead of scrolling sideways, keeping their indent: values in a narrow column such as a sheet.