Compact review card showing user avatar, name, timestamp, 0–5 star rating, and review text. Uses icon stars with accessible labelling and truncation for long content.
Prop | Type | Default / Req. | Description |
---|---|---|---|
rating | Number | required | Star rating from 0 to 5 (integers recommended). Renders filled and empty stars accordingly. |
name | String | required | Reviewer name displayed in the header and used in the avatar alt text. |
image | String | required | URL of the reviewer avatar image. |
time | String | required | Human-readable time or date label shown under the name (e.g. '2 days ago' or '2025-08-20'). |
text | String | required | Review body text. Preserves line breaks and is truncated in the preview. |
@nuxt/icon
You may use these UI components in your own personal or commercial projects. You may not resell, redistribute, sublicense, or package them as standalone assets or template/library packs.
Full terms: End-User License Agreement
Below you can expand the main implementation file and any supporting components. Use the “Copy” button to grab a snippet straight to your clipboard.
These are the raw components that are required to run this example. Copy-paste them into your project. Most likely you will not change anything in these files, but you can if you want to. These are the components that are used in the main implementation file.
<script setup>
const props = defineProps({
rating: { type: Number, required: true }, // 0..5
name: { type: String, required: true },
image: { type: String, required: true },
time: { type: String, required: true },
text: {
type: String,
required: true,
},
});
</script>
<template>
<article
class="group rounded-iq-roundness p-5 transition font-iq-paragraph leading-iq-paragraph tracking-iq-paragraph text-iq-paragraph-color "
>
<!-- header -->
<header class="flex items-center gap-3">
<!-- avatar (initials, no images, because we're being minimal) -->
<img
:src="image"
:alt="`Image of ${name}`"
class="grid h-12 w-12 rounded-full object-cover"
/>
<div class="min-w-0">
<p class="truncate text-sm font-medium">
{{ name }}
</p>
<p class="text-xs ">{{ time }}</p>
</div>
</header>
<!-- rating -->
<div class="mt-3 flex items-center gap-2" aria-label="Review rating" role="img">
<div class="relative inline-block">
<!-- empty stars -->
<div class="flex">
<Icon name="material-symbols:star-rate-rounded" v-for="i in rating"
:key="'full-' + i"
style="color: #FBBF24;"
/>
<Icon name="material-symbols:star-rate-rounded" v-for="i in 5 - rating"
:key="'empty-' + i" style="color: #D1D5DB;" />
</div>
</div>
<span class="text-xs font-semibold ">
{{ rating }} / 5
</span>
</div>
<!-- body -->
<p
class="mt-3 whitespace-pre-line truncate "
>
{{ text }}
</p>
</article>
</template>
This is the main Vue file that uses the component. Copy-paste this into your project. In this code feel free to change anything you like, such as the component name, props, or class. This is the place where you control the main component.
<template>
<div class="iq-card-glass md:w-[30vw] mx-auto">
<TestimonialsStars
class="h-96 md:h-full overflow-y-auto "
name="John Doe"
image="/images/profile-pic.jpg"
time="2 weeks ago"
text="
This product is amazing! It has changed my life for the better.
I highly recommend it to anyone looking for a positive change.
Also, the customer service was excellent!
"
:rating="4"
/>
</div>
</template>
Decide whether you want a global design-system or a one-off inline snippet.
Complete @theme
block – import once and share across every component.
Copy the code below into main.css
file. It is most likely in assets/css/main.css
directory.
:style
binding – paste straight onto any of ours components.
Copy the code below and paste it into the :style
binding of the component.
I wish I could automate every little thing—but for now you’ll need to handle these final steps by hand. Apologies for the extra work!
iq-card-*
style Now that you’ve picked a card preset, copy its CSS into your @layer components
block in main.css
. This ensures every `iq-card
` wrapper will look just right.
iq-cta
iq-cta is the main call to action button class. It’s used in many places across the components. But for now it is only a single class that you can customize. You can copy the code below and paste it into your @layer components
block in main.css
. In future you will be able to fully customize it from our UI and choose from many presets.
I didn't have time to figure out consistency. Although there are no actions required, be mindful that the forms might not be entirely consistent with the design system. A quick once-over will keep everything looking sharp.