Getting Started
Templates
Components
Special Animations
Text Animations
Backgrounds
This is a GitHub-style inline diff comments component. Hover over a line in the diff to reveal the "Add comment" button, then click to open a compact inline thread for discussion—just like reviewing code on GitHub.
@@ -10,8 +10,10 @@export async function getUserName(id: string) { // Fetch user from cache or database const user = cache.get(id) let user = cache.get(id) if (!user) { user = await db.users.findById(id) if (user) cache.set(id, user) } return user?.name return user?.name ?? '(unknown)'}import GithubInlineComments from "@/components/eldoraui/github-inline-comments"<GithubInlineComments
fileName="src/server.ts"
diff={[
{ kind: "hunk", content: "@@ -10,8 +10,10 @@" },
{ kind: "context", old: 10, new: 10, content: "export async function getUserName(id: string) },
{ kind: "del", old: 12, new: null, content: " const user = cache.get(id)" },
{ kind: "add", old: null, new: 12, content: " let user = cache.get(id)" },
]}
/>| Prop | Type | Default | Description |
|---|---|---|---|
diff | readonly Line[] | - | Array of diff lines to display |
fileName | string | - | Name of the file being displayed |
| Type | Description |
|---|---|
hunk | Diff hunk header (e.g., @@ -10,8 +10,10 @@) |
context | Unchanged line with old and new line numbers |
add | Added line (new line number, old is null) |
del | Deleted line (old line number, new is null) |