github-inline-comments-demo
eldoraui/github-inline-comments-demoFreeExample
Example showing a github-inline-comments-demo component.
Live preview
live · rendered by the registry
Rendered by eldoraui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://eldoraui.site/r/github-inline-comments-demo.jsonSource
1"use client"23import GithubInlineComments from "@/registry/eldoraui/github-inline-comments"45export default function GithubInlineCommentsDemo() {6 return (7 <div className="mx-auto max-w-4xl p-4">8 <p className="text-muted-foreground mb-4 text-sm">9 This is a GitHub-style inline diff comments component. Hover over a line10 in the diff to reveal the "Add comment" button, then click to11 open a compact inline thread for discussion—just like reviewing code on12 GitHub.13 </p>14 <GithubInlineComments15 fileName="src/server.ts"16 diff={[17 { kind: "hunk", content: "@@ -10,8 +10,10 @@" },18 {19 kind: "context",20 old: 10,21 new: 10,22 content: "export async function getUserName(id: string) {",23 },24 {25 kind: "context",26 old: 11,27 new: 11,28 content: " // Fetch user from cache or database",29 },30 {31 kind: "del",32 old: 12,33 new: null,34 content: " const user = cache.get(id)",35 },36 {37 kind: "add",38 old: null,39 new: 12,40 content: " let user = cache.get(id)",41 },42 { kind: "context", old: 13, new: 13, content: " if (!user) {" },43 {44 kind: "add",45 old: null,46 new: 14,47 content: " user = await db.users.findById(id)",48 },49 {50 kind: "add",51 old: null,52 new: 15,53 content: " if (user) cache.set(id, user)",54 },55 { kind: "context", old: 14, new: 16, content: " }" },56 { kind: "del", old: 15, new: null, content: " return user?.name" },57 {58 kind: "add",59 old: null,60 new: 17,61 content: " return user?.name ?? '(unknown)'",62 },63 { kind: "context", old: 16, new: 18, content: "}" },64 ]}65 />66 </div>67 )68}
What it pulls in
Other registry items
Files it writes
More from eldoraui
All 115 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| animated-badge-demoanimated-badge-demo | eldoraui | Examples | Free | no deps | |
| animated-frameworks-demoanimated-frameworks-demo | eldoraui | Examples | Free | no deps | |
| animated-grid-pattern-demoanimated-grid-pattern-demo | eldoraui | Examples | Free | no deps | |
| animated-list-demoanimated-list-demo | eldoraui | Examples | Free | no deps | |
| animated-shiny-button-demoanimated-shiny-button-demo | eldoraui | Examples | Free | no deps | |
| blur-in-text-demoblur-in-text-demo | eldoraui | Examples | Free | no deps | |
| browser-demobrowser-demo | eldoraui | Examples | Free | no deps | |
| browser-demo-2browser-demo-2 | eldoraui | Examples | Free | no deps |
