docs/components/display/DiffView

DiffView

Side-by-side and inline diff viewer.

import { DiffView } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
diff *stringRaw unified diff text (e.g. git diff / gh pr diff output).
viewDiffViewModeInitial layout: side-by-side split (default) or single-column unified.
languagestringSyntax-highlighting language for code lines. Auto-detects when omitted.
classstringAdditional CSS classes.
styleJSX.CSSPropertiesInline styles.

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-bg-primary
  • --sk-bg-secondary
  • --sk-border
  • --sk-custom-code-attr
  • --sk-custom-code-builtin
  • --sk-custom-code-function
  • --sk-custom-code-keyword
  • --sk-custom-code-number
  • --sk-custom-code-string
  • --sk-custom-code-type
  • --sk-diff-code-min
  • --sk-diff-mark-w
  • --sk-diff-num-w
  • --sk-error
  • --sk-font-mono
  • --sk-font-sans
  • --sk-font-size-sm
  • --sk-radius-md
  • --sk-space-2xs
  • --sk-space-md
  • --sk-space-sm
  • --sk-space-xs
  • --sk-success
  • --sk-text-muted
  • --sk-text-primary
  • --sk-text-secondary