code-block-compare-demo
jolyui-ui/code-block-compare-demoFreeExample
jolyui/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by jolyui/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://jolyui.dev/r/code-block-compare-demo.jsonSource
1import { CodeCompare } from "@/registry/default/ui/code-block";23const beforeCode = `function add(a, b) {4 return a + b;5}`;67const afterCode = `function add(a: number, b: number): number {8 return a + b;9}`;1011export default function CodeBlockCompareDemo() {12 return (13 <div className="w-full max-w-4xl">14 <CodeCompare15 before={beforeCode}16 after={afterCode}17 language="typescript"18 beforeTitle="JavaScript"19 afterTitle="TypeScript"20 showDiff={true}21 />22 </div>23 );24}
What it pulls in
Other registry items
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-box-demoai-prompt-box-demo | jolyui/ui | Examples | Free | no deps | |
| ai-prompt-box-loading-demoai-prompt-box-loading-demo | jolyui/ui | Examples | Free | no deps | |
| animated-beam-bidirectional-demoanimated-beam-bidirectional-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-curved-demoanimated-beam-curved-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-demoanimated-beam-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-multiple-demoanimated-beam-multiple-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-table-basic-demoanimated-table-basic-demo | jolyui/ui | Examples | Free | no deps | |
| animated-table-column-demoanimated-table-column-demo | jolyui/ui | Examples | Free | no deps |
