---
title: "Code Diff"
description: "An edit shown as a colored diff — removed lines collapse in red, added lines expand in green."
---

# Code Diff

An edit shown as a colored diff — removed lines collapse in red, added lines expand in green.

`code` `code-animation` `diff` `developer`

<video className="w-full aspect-video rounded-xl object-cover bg-zinc-100 dark:bg-zinc-800" src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/code-diff.mp4" poster="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/code-diff.png" autoPlay muted loop playsInline />

## Install

<CodeGroup>

```bash Terminal
npx hyperframes add code-diff
```

</CodeGroup>

## Details

| Property | Value |
| --- | --- |
| Type | Block |
| Dimensions | 1920×1080 |
| Duration | 6s |

## Files

| File | Target | Type |
| --- | --- | --- |
| `code-diff.html` | `compositions/code-diff.html` | hyperframes:composition |

## Usage

After installing, add the block to your host composition:

```html
<div data-composition-id="code-diff" data-composition-src="compositions/code-diff.html" data-start="0" data-duration="6" data-track-index="1" data-width="1920" data-height="1080"></div>
```
