AI Agents Fancy Stable

CodeDiff

Unified diff tuned for chat width: one foldable card per file, tinted add/delete rows, and a copy-safe gutter

Preview

Installation

pnpm add fancy-ui-svelte
import { CodeDiff } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { CodeDiff } from 'fancy-ui-svelte';
</script>

<CodeDiff />

Examples

Basic Usage

Props

PropTypeDefaultDescription
diff *string-Raw unified diff text, headers and all; parsed on every change, so a patch still arriving can be handed over as it grows
filename string-Header label when the patch names no file, or names exactly one
lineNumbers booleantrueWhether to show the old/new line-number gutters
collapsed booleanfalseWhether the bodies are folded away (bindable). Set it and the whole patch folds; a click folds one file and writes back whether anything is left open
maxLines number0Lines shown per file before the rest hide behind a "Show N more lines" button; 0 shows everything
wrap booleanfalseWhether long lines wrap instead of scrolling sideways