ComponentsTestimonial Card

Credit goes to alberduris for re-creating this ShipFast component.

Table of Contents:

You can show your testimonial in card layout.

Testimonial Card Component

Code

/components/TestimonialCard.tsx

1import React from "react";
2import Image from "next/image";
3
4function TestimonialCard({
5  testimonialText,
6  imageName,
7  altText,
8  personName,
9  company,
10}: {
11  testimonialText: string;
12  imageName: string;
13  altText: string;
14  personName: string;
15  company: string;
16}) {
17  return (
18    <div className="mx-auto max-w-md space-y-4">
19      <svg
20        xmlns="http://www.w3.org/2000/svg"
21        className="w-8 fill-success"
22        viewBox="0 0 35 30"
23        fill="none"
24      >
25                <path d="M22.3838 27.6777C23.5264 28.9961 25.3721 29.6992 27.4814 29.6992C31.6123 29.6992 34.249 26.9746 34.249 22.7559C34.249 18.625 31.5244 15.6367 27.6572 15.6367C26.8662 15.6367 25.9873 15.8125 25.1084 16.0762C24.5811 9.48438 27.833 4.03516 32.2275 2.36523L31.7881 0.871094C24.2295 3.77148 19.4834 11.1543 19.4834 19.8555C19.4834 22.668 20.5381 25.7441 22.3838 27.6777ZM0.499023 19.8555C0.499023 24.6895 3.22363 29.6992 8.49707 29.6992C12.54 29.6992 15.1768 26.9746 15.1768 22.7559C15.1768 18.625 12.4521 15.6367 8.67285 15.6367C7.88184 15.6367 7.00293 15.8125 6.12402 16.0762C5.59668 9.48438 8.84863 4.03516 13.2432 2.36523L12.7158 0.871094C5.24512 3.77148 0.499023 11.1543 0.499023 19.8555Z"></path>
26
27      </svg>
28      <p className="leading-relaxed md:text-lg">{testimonialText}</p>
29      <div className="flex items-center gap-2">
30        <Image
31          src={imageName}
32          alt={altText}
33          loading="lazy"
34          width="48"
35          height="48"
36          decoding="async"
37          data-nimg="1"
38          className="h-10 w-10 rounded-full object-cover"
39          style={{ color: "transparent" }}
40        />
41        <p>
42          {personName}, <span className="font-bold">{company}</span>
43        </p>
44      </div>
45    </div>
46  );
47}
48
49export default TestimonialCard;

Usage

/components/Demo.tsx

1import TestimonialCard from "./TestimonialCard";
2
3function Demo() {
4  return (
5    <>
6      <section>
7        ...
8        <TestimonialCard
9          testimonialText="I was able to launch many projects using this boilerplate!"
10          imageName="/marc.png"
11          altText="Marc Lou"
12          personName="Marc Lou"
13          company="ShipFast"
14        />
15        ...
16      </section>
17    </>
18  );
19}
20
21export default Demo;