Components
Testimonial Card
A customer quote with rating, avatar and attribution.
Installation
$ npx veil-ui@latest add testimonial-cardUsage
import { TestimonialCard } from "@/components/ui/testimonial-card";
<TestimonialCard
quote="We shipped our dashboard two weeks early."
name="Mira Chen"
role="Product lead"
rating={5}
/>;Examples
Basic
The components feel considered. We shipped our dashboard two weeks ahead of schedule.
MCMira Chen · Product lead, Northwind
Compact
Great defaults and an API that stays out of the way.
SOSam Okafor · Staff engineer
API reference
The package exports testimonial-card along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.
Accessibility
- Content uses semantic HTML — lists are lists, tables are tables and metadata uses a definition list.
- Interactive elements are real buttons or links with visible focus states.
- Images require meaningful
alttext; icons used decoratively arearia-hidden.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add testimonial-card --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { computed } from "vue";
import { Quote, Star } from "lucide-vue-next";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Card, CardContent, CardFooter } from "@/components/ui/card";
import { cn } from "@/lib/utils";
const props = defineProps<{
quote: string;
name: string;
role?: string;
avatarSrc?: string;
rating?: number;
class?: string;
}>();
const fallback = computed(() =>
props.name
.split(" ")
.map((part) => part[0])
.join("")
.slice(0, 2)
.toUpperCase(),
);
</script>
<template>
<Card data-slot="testimonial-card" :class="cn('max-w-md gap-3', props.class)">
<CardContent class="space-y-4">
<Quote class="size-6 text-primary/40" aria-hidden="true" />
<div
v-if="rating !== undefined"
class="flex items-center gap-0.5"
role="img"
:aria-label="`${rating} out of 5 stars`"
>
<Star
v-for="index in 5"
:key="index"
:class="
cn(
'size-3.5',
index <= rating
? 'fill-amber-500 text-amber-500'
: 'text-muted-foreground/40',
)
"
aria-hidden="true"
/>
</div>
<blockquote class="text-sm leading-relaxed">
<slot name="quote">{{ quote }}</slot>
</blockquote>
</CardContent>
<CardFooter class="gap-3">
<Avatar size="sm">
<AvatarImage v-if="avatarSrc" :src="avatarSrc" alt="" />
<AvatarFallback>{{ fallback }}</AvatarFallback>
</Avatar>
<figcaption class="text-sm">
<span class="font-medium">{{ name }}</span>
<span v-if="role" class="text-muted-foreground"> · {{ role }}</span>
</figcaption>
</CardFooter>
</Card>
</template>