Frontend Lab
← 回到所有模式
PG04📐 Layout · 版型見證

Testimonial

客戶見證

難度 ★★★★★標籤 testimonial · quote · avatar3 min read

模式簡述

Testimonial:客戶/使用者見證。用真實照片、職稱、公司提升可信度。比廣告詞有效 10 倍。

"最完整的前端模式收藏,幾乎每天都會回來查。"

陳冠廷

前端工程師 @ Linear

單則|大型引言 + 客戶

Claude Code Prompt

💬 Claude Code Prompt
參考:PG04 testimonial
組件:Testimonial.tsx

Testimonial:客戶/使用者見證。用真實照片、職稱、公司提升可信度。比廣告詞有效 10 倍。

限制:
- 人物頭像用 stock photo
- quote 太長
- 只放好話

完整程式碼

Testimonial.tsx
"use client";
import { Star } from "lucide-react";

type State = "single" | "grid" | "compact";

const Q = [
{ name: "陳冠廷", role: "前端工程師 @ Linear", quote: "最完整的前端模式收藏,幾乎每天都會回來查。" },
{ name: "Sarah Kim", role: "Design Engineer", quote: "Apple 系列的動效很到位,直接救了我們的 onboarding。" },
{ name: "Yuki Tanaka", role: "Indie Hacker", quote: "從 hero 到 footer 全有,我的 landing page 半天搞定。" },
{ name: "陳哲明", role: "CTO @ startup", quote: "團隊新人入職第一天就推他們先把這站讀完。" },
];

export function Testimonial({ state = "single" }: { state?: State }) {
if (state === "compact") {
  return (
    <div className="flex w-full max-w-xl items-center gap-3 rounded-lg border border-border bg-background/30 p-4">
      <div className="grid h-10 w-10 place-items-center rounded-full bg-lab-accent/20 font-mono text-xs text-lab-accent">

      </div>
      <div className="flex-1">
        <p className="text-xs italic text-foreground">"{Q[0].quote}"</p>
        <p className="mt-1 font-mono text-[10px] text-muted-foreground">{Q[0].name}, {Q[0].role}</p>
      </div>
    </div>
  );
}

if (state === "grid") {
  return (
    <div className="grid w-full grid-cols-2 gap-3">
      {Q.map((q) => (
        <div key={q.name} className="rounded-lg border border-border bg-background/30 p-4">
          <div className="mb-2 flex gap-0.5 text-amber-500">
            {Array.from({ length: 5 }).map((_, i) => (
              <Star key={i} className="h-3 w-3 fill-current" />
            ))}
          </div>
          <p className="text-xs leading-relaxed text-foreground">"{q.quote}"</p>
          <p className="mt-3 font-mono text-[10px] text-muted-foreground">{q.name} · {q.role}</p>
        </div>
      ))}
    </div>
  );
}

return (
  <div className="w-full max-w-xl rounded-xl border border-border bg-background/30 p-6">
    <div className="mb-3 flex gap-0.5 text-amber-500">
      {Array.from({ length: 5 }).map((_, i) => (
        <Star key={i} className="h-4 w-4 fill-current" />
      ))}
    </div>
    <p className="text-base italic leading-relaxed text-foreground">"{Q[0].quote}"</p>
    <div className="mt-4 flex items-center gap-3">
      <div className="grid h-10 w-10 place-items-center rounded-full bg-lab-accent/20 font-mono text-xs text-lab-accent">

      </div>
      <div>
        <p className="text-xs font-medium">{Q[0].name}</p>
        <p className="font-mono text-[10px] text-muted-foreground">{Q[0].role}</p>
      </div>
    </div>
  </div>
);
}

何時用

  • ✅ marketing landing page
  • ✅ 案例研究 case study
  • ✅ Pricing 頁加強信任

何時別用

  • ❌ 假評論(會被識破,反效果)
  • ❌ B2B 產品但客戶不能露面(用 logo wall)
  • ❌ 產品太新沒有真實 case(先做出有意義的)

我踩過的坑

  1. 人物頭像用 stock photo:使用者一眼看穿。要嘛真實照片,要嘛抽象 avatar。

  2. quote 太長:超過 2-3 行沒人讀。提煉精華句。

  3. 只放好話:太完美反而假。可以放 ‘最開始我懷疑…但後來’ 的轉折。

相關模式

  • PG06
  • PG02

搜尋

按 ⌘K 隨時開啟