Components / Prompt Builders
Prompt Version Diff
A version comparison tool showing prompt iterations with visual diff highlighting and restore functionality.
Components / Prompt Builders
A version comparison tool showing prompt iterations with visual diff highlighting and restore functionality.
Pass Rate
92% +4%
Latency
1.1s -200ms
Install the core libraries required for this component.
npm install react lucide-react"use client";
import React from "react";
import { GitCompare, ArrowRight, Minus, Plus } from "lucide-react";
export default function PromptVersionDiff() {
return (
<div className="rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-6 shadow-sm w-full max-w-2xl mx-auto overflow-hidden">
<div className="flex items-center justify-between mb-8">
<h3 className="text-sm font-bold text-zinc-900 dark:text-zinc-100 flex items-center gap-2">
<GitCompare className="h-4 w-4 text-zinc-400" />
v1.2 vs v1.3 Diff
</h3>
<span className="text-[10px] font-black text-zinc-400 uppercase tracking-widest">3 changes detected</span>
</div>
<div className="space-y-1 font-mono text-[11px] leading-relaxed">
<div className="p-3 bg-zinc-50 dark:bg-zinc-900 rounded-t-lg text-zinc-400">
## System Instructions
</div>
<div className="px-3 py-1 bg-red-500/10 text-red-600 dark:text-red-400 flex items-start gap-4">
<Minus className="h-3 w-3 mt-1 shrink-0" />
<span>You are a helpful assistant that writes code.</span>
</div>
<div className="px-3 py-1 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-start gap-4">
<Plus className="h-3 w-3 mt-1 shrink-0" />
<span>You are a world-class senior React developer specializing in Tailwind.</span>
</div>
<div className="px-3 py-1 text-zinc-400 flex items-start gap-4">
<span className="w-3" />
<span>Output only valid TSX without explanation.</span>
</div>
<div className="px-3 py-1 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-start gap-4">
<Plus className="h-3 w-3 mt-1 shrink-0" />
<span>Always use lucide-react for icons.</span>
</div>
</div>
<div className="mt-8 flex items-center justify-center gap-8">
<div className="text-center">
<p className="text-[10px] font-black text-zinc-400 uppercase mb-1">Pass Rate</p>
<p className="text-xl font-bold text-zinc-900 dark:text-zinc-100">92% <span className="text-xs text-emerald-500">+4%</span></p>
</div>
<ArrowRight className="h-4 w-4 text-zinc-200" />
<div className="text-center">
<p className="text-[10px] font-black text-zinc-400 uppercase mb-1">Latency</p>
<p className="text-xl font-bold text-zinc-900 dark:text-zinc-100">1.1s <span className="text-xs text-emerald-500">-200ms</span></p>
</div>
</div>
</div>
);
} "use client";
import React from "react";
import { GitCompare, ArrowRight, Minus, Plus } from "lucide-react";
export default function PromptVersionDiff() {
return (
<div className="rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-6 shadow-sm w-full max-w-2xl mx-auto overflow-hidden">
<div className="flex items-center justify-between mb-8">
<h3 className="text-sm font-bold text-zinc-900 dark:text-zinc-100 flex items-center gap-2">
<GitCompare className="h-4 w-4 text-zinc-400" />
v1.2 vs v1.3 Diff
</h3>
<span className="text-[10px] font-black text-zinc-400 uppercase tracking-widest">3 changes detected</span>
</div>
<div className="space-y-1 font-mono text-[11px] leading-relaxed">
<div className="p-3 bg-zinc-50 dark:bg-zinc-900 rounded-t-lg text-zinc-400">
## System Instructions
</div>
<div className="px-3 py-1 bg-red-500/10 text-red-600 dark:text-red-400 flex items-start gap-4">
<Minus className="h-3 w-3 mt-1 shrink-0" />
<span>You are a helpful assistant that writes code.</span>
</div>
<div className="px-3 py-1 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-start gap-4">
<Plus className="h-3 w-3 mt-1 shrink-0" />
<span>You are a world-class senior React developer specializing in Tailwind.</span>
</div>
<div className="px-3 py-1 text-zinc-400 flex items-start gap-4">
<span className="w-3" />
<span>Output only valid TSX without explanation.</span>
</div>
<div className="px-3 py-1 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-start gap-4">
<Plus className="h-3 w-3 mt-1 shrink-0" />
<span>Always use lucide-react for icons.</span>
</div>
</div>
<div className="mt-8 flex items-center justify-center gap-8">
<div className="text-center">
<p className="text-[10px] font-black text-zinc-400 uppercase mb-1">Pass Rate</p>
<p className="text-xl font-bold text-zinc-900 dark:text-zinc-100">92% <span className="text-xs text-emerald-500">+4%</span></p>
</div>
<ArrowRight className="h-4 w-4 text-zinc-200" />
<div className="text-center">
<p className="text-[10px] font-black text-zinc-400 uppercase mb-1">Latency</p>
<p className="text-xl font-bold text-zinc-900 dark:text-zinc-100">1.1s <span className="text-xs text-emerald-500">-200ms</span></p>
</div>
</div>
</div>
);
} Internal functions used to handle component logic.
| Function | Parameters |
|---|---|
| PromptVersionDiff() | None |
Every JSX/HTML tag used in this component, with usage count and source.
| Tag | Count | Type | Source |
|---|---|---|---|
| <ArrowRight> | 1× | | lucide-react |
| <GitCompare> | 1× | | lucide-react |
| <Minus> | 1× | | lucide-react |
| <Plus> | 2× | | lucide-react |
| <div> | 11× | | Native HTML |
| <h3> | 1× | | Native HTML |
| <p> | 4× | | Native HTML |
| <span> | 8× | | Native HTML |