Page sections / Testimonials

Speaker Testimonial Rail

Row of avatar + name + handle + role entries where the center one sits in a glowing bordered card and the sides fade away. Beneath a hairline, a two-column split pairs mono key/value rows (Favorite Feature, Top Extension) with chip badges and a large quote with partially bright highlighted words.

Rebuilt from raycast.com in the Obsidian Launcher style.

npx shadcn@latest add https://justyoink.it/r/obsidian-launcher/blocks/speaker-testimonial-rail.json

Looks exactly like raycast.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Pass `speakers` (array with name, handle, role, feature, extension, notes and quote parts), plus `headline`, `subheadline` and `interval` (ms). The rail auto-rotates the center speaker; dots below allow manual selection.

components/speaker-testimonial-rail.tsx
"use client";

import { useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
import { useState, useEffect } from "react";

type Speaker = {
  name: string;
  handle: string;
  role: string;
  feature: string;
  featureNote: string;
  extension: string;
  extensionNote: string;
  quoteStart: string;
  quoteBright: string;
  quoteEnd: string;
  hue: string;
};

const defaultSpeakers: Speaker[] = [
  { name: "Imogen Hartley", handle: "@imogenh", role: "Founder, Kitefield", feature: "Smart Notes", featureNote: "Capture ideas instantly, from any window.", extension: "Calendar Sync", extensionNote: "I wired it to our team board so standups schedule themselves each morning.", quoteStart: "Northwind quietly", quoteBright: "removed half the busywork from my week", quoteEnd: "and I never looked back.", hue: "#e5484d" },
  { name: "Daniel Okafor", handle: "@dokafor", role: "Lead Engineer, Altura", feature: "Quick Launch", featureNote: "Jump into any project in a couple of keystrokes.", extension: "Snippet Vault", extensionNote: "I reuse my team's reply templates across every inbox without thinking about it.", quoteStart: "It feels like", quoteBright: "a faster keyboard for my whole computer", quoteEnd: "and that's rare.", hue: "#3b82f6" },
  { name: "Priya Raman", handle: "@priyar", role: "Designer, Lumen", feature: "Clipboard Rail", featureNote: "Everything you copied, searchable on demand.", extension: "Palette Picker", extensionNote: "Grabbing exact brand colors for a mockup now takes me a single shortcut.", quoteStart: "My tools finally", quoteBright: "stay out of the way and just work", quoteEnd: "every single day.", hue: "#22c55e" },
];

export default function SpeakerTestimonialRail({
  headline = "Made for people who ship.",
  subheadline = "Trusted by teams that move fast.",
  speakers = defaultSpeakers,
  interval = 5000,
}: {
  headline?: string;
  subheadline?: string;
  speakers?: Speaker[];
  interval?: number;
}) {
  const [active, setActive] = useState(0);
  const n = speakers.length;

  useEffect(() => {
    const t = setInterval(() => setActive((a) => (a + 1) % n), interval);
    return () => clearInterval(t);
  }, [n, interval]);

  const s = speakers[active];
  const initials = (name: string) => name.split(" ").map((p) => p[0]).join("");
  const prev = speakers[(active + n - 1) % n];
  const next = speakers[(active + 1) % n];

  const Avatar = ({ sp }: { sp: Speaker }) => (
    <span className="flex h-12 w-12 shrink-0 items-center justify-center rounded-pill text-ui font-medium text-primary" style={{ background: `radial-gradient(circle at 30% 25%, ${sp.hue}, #111214)` }}>
      {initials(sp.name)}
    </span>
  );

  const Entry = ({ sp, dim }: { sp: Speaker; dim?: boolean }) => (
    <div className={`flex items-center gap-6 ${dim ? "opacity-30" : ""}`}>
      <Avatar sp={sp} />
      <div className="min-w-0">
        <p className="whitespace-nowrap text-ui"><span className="font-medium text-primary">{sp.name}</span> <span className="ml-1 text-tertiary">{sp.handle}</span></p>
        <p className="whitespace-nowrap text-ui text-secondary">{sp.role}</p>
      </div>
    </div>
  );

  return (
    <section className="relative isolate overflow-hidden bg-canvas px-6 py-24 font-sans text-primary">
      <div className="pointer-events-none absolute inset-x-0 top-40 -z-10 mx-auto h-[340px] max-w-5xl bg-[radial-gradient(50%_65%_at_50%_0%,rgba(255,255,255,0.05),transparent)]" />
      <Reveal>
        <div className="mx-auto max-w-xl text-center text-body-lg">
          <p className="text-primary">{headline}</p>
          <p className="text-tertiary">{subheadline}</p>
        </div>
      </Reveal>

      <div className="mx-auto mt-16 max-w-6xl [mask-image:linear-gradient(90deg,transparent_3%,#000_30%,#000_70%,transparent_97%)]">
        <div className="hidden items-center justify-between gap-8 md:flex">
          <div className="w-[340px]"><Entry sp={prev} dim /></div>
          <div className="w-[340px] rounded-xl border border-hairline bg-surface p-6 shadow-soft-glow transition-all duration-card-hover">
            <Entry sp={s} />
          </div>
          <div className="w-[340px]"><Entry sp={next} dim /></div>
        </div>
        <div className="flex justify-center md:hidden">
          <div className="rounded-xl border border-hairline bg-surface p-5 shadow-soft-glow"><Entry sp={s} /></div>
        </div>
      </div>

      <div className="mx-auto mt-14 flex max-w-6xl justify-center gap-2">
        {speakers.map((sp, i) => (
          <button key={sp.handle} aria-label={`Show ${sp.name}`} onClick={() => setActive(i)} className={`h-1.5 rounded-pill transition-all focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-red ${i === active ? "w-6 bg-primary" : "w-1.5 bg-hairline"}`} />
        ))}
      </div>

      <div className="mx-auto mt-10 h-px max-w-5xl bg-gradient-to-r from-transparent via-hairline to-transparent" />

      <div key={active} className="mx-auto mt-24 grid max-w-6xl animate-fade-in-up gap-12 md:grid-cols-2 md:gap-0">
        <dl className="space-y-10 md:pr-12">
          {[
            ["Favorite Feature:", s.feature, s.featureNote],
            ["Top Extension:", s.extension, s.extensionNote],
          ].map(([k, chip, note]) => (
            <div key={k} className="grid grid-cols-[110px_1fr] gap-x-6 sm:grid-cols-[165px_1fr]">
              <dt className="pt-1 font-mono text-mono-label text-tertiary">{k}</dt>
              <dd>
                <span className="inline-flex items-center gap-2 rounded-md bg-overlay-subtle px-2 py-1 text-ui text-primary">
                  <span className="h-3 w-3 rounded-xs bg-accent-red" />
                  {chip}
                </span>
                <p className="mt-4 text-ui text-secondary">{note}</p>
              </dd>
            </div>
          ))}
        </dl>
        <figure className="relative flex items-center border-hairline md:border-l md:pl-12">
          <span aria-hidden className="absolute left-0 top-0 font-serif-accent text-5xl text-faint md:left-8">“</span>
          <blockquote className="py-8 text-body-lg text-tertiary">
            {s.quoteStart}{" "}
            <span className="text-primary transition-colors duration-[900ms]">{s.quoteBright}</span>{" "}
            {s.quoteEnd}
          </blockquote>
        </figure>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  const offset = {
    up: `translate3d(0, ${distance}px, 0)`,
    down: `translate3d(0, ${-distance}px, 0)`,
    left: `translate3d(${-distance}px, 0, 0)`,
    right: `translate3d(${distance}px, 0, 0)`,
    scale: "scale(0.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {children}
    </Tag>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Obsidian Launcher

The whole style →

AI Agent Bento Showcase

Feature sections

Blog Category Filter Row

Tab bars

Frosted Pill Navbar

Headers & nav bars

Centered Glow Hero

Heroes

Light Pill Download Button

Buttons

Launcher Window Showcase

Media & mockups