# DiffView

Two text versions, aligned by line, with changes made visible.

- Family: Data, imported from `mizu-ui` or `mizu-ui/data`
- Docs: https://mizu.user64bit.world/components/diff-view
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/data/Inspection.tsx

## Usage

```tsx
import { DiffView } from "mizu-ui";

export function Example() {
  return (
    <DiffView
      before={"surface: ink\nfocus: muted\nmotion: always"}
      after={"surface: ink\nfocus: accent\nmotion: reduced-safe"}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/diff-view
```

## Props

- `before / after`: `string`. The two complete texts.
- `beforeLabel / afterLabel`: `string`. Version labels.

## Accessibility

Each version is a named section with selectable code. This is an aligned-line comparison, not an edit-distance engine; insertions may mark following lines changed.

## Motion

Static version comparison.
