Skip to content
Klarhimmel UI

Testimonials, carousel

Testimonials, carousel previewTestimonials, carousel preview

Install

npx shadcn add @klarhimmel/testimonials-carousel
DetailsAbout, usage, props and more

One quote at a time with previous and next buttons. Moves only when pressed; every quote shows while editing.

Import

Import

import Block from '@/components/klarhimmel/blocks/testimonials-carousel';
Also called
  • testimonials/carousel
Category
What customers say, one quote or many. New project? Set it up once: /get-started/installation.

Notes

When to use it

One quote at a time with previous and next buttons, for up to six portraits of customers. If all quotes should be visible without a click, use testimonials-grid or testimonials-wall.

Writing for it

- Every item needs a quote (400 characters), a name, a role and a portrait. The portrait is shown large on wide containers, so use a square crop. - Order the items with the strongest quote first, because that is the one visible when the page loads. - Keep the quotes about the same length. Slides swap in place, and a short slide after a long one makes the box jump in height.

Watch out for

It only moves when someone presses a button, and the buttons and counter are hidden when there is a single item. While editing in the canvas all quotes are shown stacked, so the real look is the published one.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import TestimonialsCarousel from '@/components/klarhimmel/blocks/testimonials-carousel';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <TestimonialsCarousel props={{
          "eyebrow": "Name the section",
          "title": "Say what the quotes show, in one short line",
          "items": [
            {
              "quote": "Quote a customer, in their words, on the result they got and what it changed for them afterwards.",
              "name": "Name a person",
              "role": "Their role and their company",
              "photo": {
                "src": "/pictures/avatar-6.svg",
                "alt": "A portrait of a person",
                "srcDark": "/pictures/avatar-6-dark.svg"
              }
            },
            {
              "quote": "Quote a customer, in their words, on the result they got and what it changed for them afterwards.",
              "name": "Name a person",
              "role": "Their role and their company",
              "photo": {
                "src": "/pictures/avatar-1.svg",
                "alt": "A portrait of a person",
                "srcDark": "/pictures/avatar-1-dark.svg"
              }
            },
            {
              "quote": "Quote a customer, in their words, on the result they got and what it changed for them afterwards.",
              "name": "Name a person",
              "role": "Their role and their company",
              "photo": {
                "src": "/pictures/avatar-2.svg",
                "alt": "A portrait of a person",
                "srcDark": "/pictures/avatar-2-dark.svg"
              }
            }
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
eyebrowstring'Name the section'Text, up to 60 characters.
titlestring'Say what the quotes show, in one sh…'Text, up to 120 characters.
switcher'arrows' | 'tabs'-One of 'arrows', 'tabs'. Optional; empty is not rendered.
panel'portrait' | 'compact'-One of 'portrait', 'compact'. Optional; empty is not rendered.
titleSize'title' | 'heading'-One of 'title', 'heading'. Optional; empty is not rendered.
items{ quote, name, role, photo }[]4 itemsList of 1 to 6. Each item: quote, name, role, photo.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.