Skip to content

TestimonialCard

SM · 950B gzip budget

Customer quote with avatar, name, and role.

Category
Media & layout
Budget
sm, single-purpose control
External runtime
React / React DOM only
axe fixtureSSR rendersource scanbundle budget

Preview

Live fixture
Preview locale
Great library!
Aisha
Developer

Try the component here. Locale-aware formatting and direction follow the selected language; example content and labels are not automatically translated. Overlay demos use interactive launchers.

Install

npx shadcn@latest add https://gear5-ui.vercel.app/r/testimonial-card.json

Copies the source into your project.

New here? Set up Tailwind and import aliases first →

Source & props

Edit on GitHub ↗

Prop types and inline documentation are included below. This is repository source; the installer rewrites shared imports for your project.

"use client";

import React from "react";

export interface TestimonialCardProps {
  quote: string;
  avatar?: React.ReactNode;
  name: string;
  role?: string;
  className?: string;
  ariaLabel?: string;
}

export function TestimonialCard({
  quote,
  avatar,
  name,
  role,
  className = "",
  ariaLabel,
}: TestimonialCardProps) {
  return (
    <figure
      aria-label={ariaLabel}
      className={className}
      style={{
        margin: 0,
        padding: "1.5rem",
        border: "1px solid var(--color-border, #e5e7eb)",
        borderRadius: "0.75rem",
        background: "var(--color-bg, #fff)",
      }}
    >
      <blockquote
        style={{
          margin: 0,
          padding: 0,
          fontSize: "1rem",
          lineHeight: 1.6,
          color: "var(--color-text, #374151)",
          fontStyle: "italic",
          marginBlockEnd: "1rem",
        }}
      >
        <span aria-hidden="true" style={{ fontSize: "1.5rem", lineHeight: 0 }}>{'\u0022'}</span>
        {quote}
        <span aria-hidden="true" style={{ fontSize: "1.5rem", lineHeight: 0 }}>{'\u0022'}</span>
      </blockquote>

      <figcaption
        style={{
          display: "flex",
          alignItems: "center",
          gap: "0.75rem",
        }}
      >
        {avatar && (
          <div
            style={{
              width: "2.5rem",
              height: "2.5rem",
              borderRadius: "50%",
              overflow: "hidden",
              flexShrink: 0,
              background: "var(--color-border, #e5e7eb)",
              display: "flex",
              alignItems: "center",
              justifyContent: "center",
            }}
          >
            {avatar}
          </div>
        )}
        <div>
          <div
            style={{
              fontWeight: 600,
              fontSize: "0.875rem",
              color: "var(--color-text, #111827)",
            }}
          >
            {name}
          </div>
          {role && (
            <div
              style={{
                fontSize: "0.75rem",
                color: "var(--color-muted, #6b7280)",
              }}
            >
              {role}
            </div>
          )}
        </div>
      </figcaption>
    </figure>
  );
}

What CI checks

Quality contract
  • Bundled, minified and gzipped against its tier budget
  • Audited by axe in the state previewed above
  • Rendered through react-dom/server with no browser globals
  • Scanned for network calls, dangerous sinks, and unguarded animation