Testimonials

Interactive testimonial wall that dims the rest and reveals the highlighted author.

Testimonials

Interactive testimonial wall that dims the rest and reveals the highlighted author.

Hover (or focus) any quote — the other quotes dim and blur away, and the author's name slides up in accent orange beside it. The preview renders the initials fallback avatars so the wall works fully offline; pass an avatar URL in your own use.

Installation

Install the component with the Craft-UI Blocks CLI — it drops testimonials.tsx into your project and wires up its runtime dependencies:

npx mvpblocks add testimonials
pnpm dlx mvpblocks add testimonials
yarn dlx mvpblocks add testimonials
bunx mvpblocks add testimonials

File Structure

The CLI saves the component to your project's components/ui folder:

Import it from @/components/ui/testimonials.

Usage

Place one Testimonial per quote inside Testimonials — the root indexes them in order to alternate tones and track the highlight:

"use client";

import { Testimonial, Testimonials } from "@/components/ui/testimonials";

export function TestimonialsPreview() {
  return (
    <Testimonials>
      <Testimonial
        avatar="/assets/av1.png"
        name="Trevor Phillips"
        title="Design Engineer @vercel"
      >
        Better than a course, it's a reference manual to making great work
        full of tactical secrets I haven't seen anywhere else.
      </Testimonial>
      <Testimonial
        avatar="/assets/av2.png"
        name="Michael De Santa"
        title="Founder @lossantos"
      >
        Notification came in. I didn't hesitate. You shouldn't either.
      </Testimonial>
      <Testimonial
        avatar="/assets/av3.png"
        name="Jose Rago"
        title="Co-founder @basementstudio"
      >
        I need to frame this at the office, wonderful work.
      </Testimonial>
    </Testimonials>
  );
}

Theming

The wall is drawn from theme tokens, with two explicit accent stops. Quotes alternate text-foreground (strong) and text-muted-foreground (muted) by position — pin one with emphasis if you want a fixed tone. On hover or focus a quote snaps to text-foreground, the rest fade to opacity: var(--testimonial-dim) (default 0.2) and blur by var(--testimonial-blur) (default 4px); both are CSS variables set on the wrapper, so you can tune them without touching the component. The attribution reveals the author's name in orange-600 (brightening to orange-500 in dark mode) with the role in text-muted-foreground, set in mono uppercase. Avatars are small rounded chips on border-border/60 (or the initials fallback on bg-muted with a border-border edge) so they read cleanly in both modes.

Animations

  • Dim and blur: everything is a native CSS pseudo-class transition driven by the wall's group :has(... :hover, :focus-visible) rule — opacity eases out over 0.2s, the filter blur settles over 0.3s on a cubic-bezier(0.32, 0.72, 0, 1), and color transitions in 0.3s. The browser applies the change to all quotes in one synchronous style/paint pass, so there is no per-element timing drift — the effect that would read as a "wave" when driven from React state instead.
  • Attribution: on hover or keyboard focus, the author's name and role slide up (translate-y-1 → 0), fade in, and un-blur over 300ms ease-out, overlaying the neighboring quote's line through a zero-width anchor rather than reflowing the paragraph.
  • Hit area: each quote pads itself by the word-gap and inter-line leading (canceled with an equal negative margin), so wrapped lines are hoverable across their full line-height, not just the glyph metrics.
  • Keyboard: quotes are focusable (tabIndex=0), and the highlight + attribution follow focus-visible exactly like hover.
  • Reduced motion: the wall pins --testimonial-blur to 0 and disables the transitions.

Props

Testimonials

Prop

Type

Testimonial

Prop

Type

index and onActiveChange are injected by Testimonials — don't set them manually.

Registry Bundle

Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together. Dependencies: none — the wall ships with no runtime packages beyond React.

Inspired by the inline testimonial layout from Rauno Freiberg.

Contact

If you find any bug or issue, feel free to raise an issue.

Last updated on