Skip to content

zk-diff ​

A unified diff, line by line, with the old and new line numbers.

Props ​

PropTypeDefaultDescription
diffstring''The diff, as git diff writes it
lineNumbersbooltrueShows the numbers (data-old and data-new, to print with CSS)
titlestring|nullnullTitle
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

The added lines are <ins>, the removed ones <del>; each line has data-type (add, remove, context, hunk or meta). Only the unified view is made. No script.

Examples ​

From git ​

blade
<x-zk-diff title="app.php" :diff="$diff" />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.