# Testimonials using Data models

**URL:** <https://forum.builder.io/t/testimonials-using-data-models/15720>\
**Category:** General\
**Created:** [September 1, 2025, 8:34am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720 "2025-09-01T08:34:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhanashree](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dhanashree](https://forum.builder.io/u/Dhanashree)\
**Post date:** [September 1, 2025, 8:34am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/1 "2025-09-01T08:34:27Z")

</div>

_I have stored a list of testimonials in the testimonials data model and accessed then on the page through data binding. I want to display 4 testimonials per carousel slide, so that 12 testimonials appear across 3 slides. How can I show 4 testimonials on each carousel slide?_

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [September 1, 2025, 11:40am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/2 "2025-09-01T11:40:10Z")

</div>

Hello @Dhanashree

Are you currently using the Builder Carousel component to display your testimonials?

If so, could you please share the Builder content link where you are testing this so we can take a closer look?

 ![](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/b/b1e06680dcbc6b15878a91b5dd4b8a0c3a0f625d.png)

---

<div class="post-metadata">

**Author:** ![Dhanashree](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dhanashree](https://forum.builder.io/u/Dhanashree)\
**Post date:** [September 2, 2025, 7:27am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/3 "2025-09-02T07:27:27Z")

</div>

Hello @manish-sharma  
Yes. I am currently using the Builder Carousel component.  
Here is the content link : [https://builder.io/content/d8a77e28733b46e3923e66f5a899c702\_f2d97cd8207f4c659940d135a795e52c](https://builder.io/content/d8a77e28733b46e3923e66f5a899c702_f2d97cd8207f4c659940d135a795e52c "https://builder.io/content/d8a77e28733b46e3923e66f5a899c702\_f2d97cd8207f4c659940d135a795e52c")

Thank You!

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [September 2, 2025, 8:14am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/4 "2025-09-02T08:14:24Z")

</div>

Hello @Dhanashree

We reviewed your content and identified an issue with the carousel width. This has now been fixed using the following CSS:

```css
.builder-carousel{
  width: 100%;
} 

```

Additionally, we updated the text [binding](https://www.builder.io/c/docs/data-binding-overview) code to:

```javascript
state.resultsItem.data.displayName

```

This resolved the issue with carousel items not displaying correctly.

If you’d like to display four items in a single slide, you can configure this by using the **Responsive** option under **Advanced Options** in the Carousel settings.

 ![Screenshot 2025-09-02 at 1.41.33 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/f/fbc9b8326f1dcb082e57112c028fbf8377be4c28.jpeg)

> **[Data Binding Overview](https://www.builder.io/c/docs/data-binding-overview)**
>
> Data binding connects data from Builder or your application to your Pages, so you can build dynamic, interactive pages without code.

Hope this helps!

Thanks,

---

<div class="post-metadata">

**Author:** ![Dhanashree](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dhanashree](https://forum.builder.io/u/Dhanashree)\
**Post date:** [September 2, 2025, 8:29am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/5 "2025-09-02T08:29:20Z")

</div>

@manish-sharma Thanks !  
Could you please suggest that How can I display the name in one below another, not in a single row?  
e.g: first David A below that Johns B, then the remaining two names . This way 4 names in one slide remaining 4 on other like that.

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [September 3, 2025, 2:00pm UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/6 "2025-09-03T14:00:12Z")

</div>

Hello @Dhanashree,

With the Builder carousel, it is possible to override the CSS to achieve this. However, a more robust approach would be to use a custom component solution instead.

Here is an example for your reference:

```typescript
"use client";
import React, { useState, useEffect } from 'react';
import { BuilderContent } from '@builder.io/sdk-react-nextjs';

interface SampleItem {
  id: string;
  title: string;
  category: string;
  price: string;
  image: string;
  description: string;
}

interface VerticalCarouselProps {
  items?: BuilderContent[];
  itemsPerSlide?: number;
  title?: string;
  subtitle?: string;
  showNavigation?: boolean;
  autoPlay?: boolean;
  autoPlayInterval?: number;
  className?: string;
  useSampleData?: boolean;
}

const VerticalCarousel: React.FC<VerticalCarouselProps> = ({
  items = [],
  itemsPerSlide = 4,
  title = "Vertical Carousel",
  subtitle,
  showNavigation = true,
  autoPlay = false,
  autoPlayInterval = 5000,
  className = "",
  useSampleData = false
}) => {
  // Sample data with 12 items
  const sampleItems: SampleItem[] = [
    {
      id: "1",
      title: "Laptop Pro X1",
      category: "Electronics",
      price: "1,299.99",
      image: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=200&h=200&fit=crop",
      description: "High-performance laptop for professionals"
    },
    {
      id: "2",
      title: "Wireless Headphones",
      category: "Audio",
      price: "199.99",
      image: "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=200&h=200&fit=crop",
      description: "Premium noise-canceling headphones"
    },
    {
      id: "3",
      title: "Smart Watch Series 5",
      category: "Wearables",
      price: "399.99",
      image: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=200&h=200&fit=crop",
      description: "Advanced fitness and health tracking"
    },
    {
      id: "4",
      title: "4K Gaming Monitor",
      category: "Displays",
      price: "599.99",
      image: "https://images.unsplash.com/photo-1547082299-de196ea013d6?w=200&h=200&fit=crop",
      description: "Ultra-high definition gaming experience"
    },
    {
      id: "5",
      title: "Mechanical Keyboard",
      category: "Accessories",
      price: "149.99",
      image: "https://images.unsplash.com/photo-1541140532154-b024d705b90a?w=200&h=200&fit=crop",
      description: "Professional mechanical switches"
    },
    {
      id: "6",
      title: "Gaming Mouse",
      category: "Accessories",
      price: "79.99",
      image: "https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=200&h=200&fit=crop",
      description: "High-precision gaming mouse"
    },
    {
      id: "7",
      title: "Bluetooth Speaker",
      category: "Audio",
      price: "89.99",
      image: "https://images.unsplash.com/photo-1608043152269-423dbba4e7e1?w=200&h=200&fit=crop",
      description: "Portable wireless speaker"
    },
    {
      id: "8",
      title: "Tablet Pro",
      category: "Electronics",
      price: "799.99",
      image: "https://images.unsplash.com/photo-1544244015-0df4b3ffc6b0?w=200&h=200&fit=crop",
      description: "Professional tablet for creative work"
    },
    {
      id: "9",
      title: "Webcam HD",
      category: "Accessories",
      price: "129.99",
      image: "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=200&h=200&fit=crop",
      description: "High-definition video calling"
    },
    {
      id: "10",
      title: "External SSD",
      category: "Storage",
      price: "199.99",
      image: "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=200&h=200&fit=crop",
      description: "Ultra-fast portable storage"
    },
    {
      id: "11",
      title: "USB-C Hub",
      category: "Accessories",
      price: "49.99",
      image: "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=200&h=200&fit=crop",
      description: "Multi-port connectivity solution"
    },
    {
      id: "12",
      title: "Wireless Charger",
      category: "Accessories",
      price: "39.99",
      image: "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=200&h=200&fit=crop",
      description: "Fast wireless charging pad"
    }
  ];

  // Use sample data if no items provided or if useSampleData is true
  const displayItems = useSampleData || items.length === 0 ? sampleItems : items;
  const [currentSlide, setCurrentSlide] = useState(0);
  const totalSlides = Math.ceil(displayItems.length / itemsPerSlide);

  // Auto-play functionality
  useEffect(() => {
    if (!autoPlay || totalSlides <= 1) return;

    const interval = setInterval(() => {
      setCurrentSlide((prev) => (prev + 1) % totalSlides);
    }, autoPlayInterval);

    return () => clearInterval(interval);
  }, [autoPlay, autoPlayInterval, totalSlides]);

  // Reset to first slide when items change
  useEffect(() => {
    setCurrentSlide(0);
  }, [items]);

  const goToSlide = (slideIndex: number) => {
    setCurrentSlide(slideIndex);
  };

  const goToNextSlide = () => {
    setCurrentSlide((prev) => (prev + 1) % totalSlides);
  };

  const goToPrevSlide = () => {
    setCurrentSlide((prev) => (prev - 1 + totalSlides) % totalSlides);
  };

  const getCurrentSlideItems = () => {
    const startIndex = currentSlide * itemsPerSlide;
    const endIndex = startIndex + itemsPerSlide;
    return displayItems.slice(startIndex, endIndex);
  };

  if (!displayItems || displayItems.length === 0) {
    return (
      <div className={`text-center py-12 ${className}`}>
        <p className="text-gray-600">No items to display.</p>
      </div>
    );
  }

  return (
    <div className={`py-8 px-4 ${className}`}>
      <div className="max-w-4xl mx-auto">
        {/* Header */}
        <div className="text-center mb-8">
          <h2 className="text-3xl font-bold text-gray-900 mb-2">{title}</h2>
          {subtitle && (
            <p className="text-xl text-gray-600">{subtitle}</p>
          )}
        </div>

        {/* Carousel Container */}
        <div className="relative">
          {/* Main Carousel */}
          <div className="bg-white rounded-lg shadow-lg p-6 min-h-[400px]">
            <div className="grid grid-cols-1 gap-4">
              {getCurrentSlideItems().map((item, index) => {
                // Handle BuilderContent items
                if ('data' in item && item.data) {
                  return (
                    <div 
                      key={item.id || `item-${index}`} 
                      className="flex items-center space-x-4 p-4 border border-gray-200 rounded-lg hover:shadow-md transition-shadow duration-200"
                    >
                      {/* Item Image */}
                      {item.data.productImage && (
                        <div className="flex-shrink-0">
                          <img
                            src={item.data.productImage}
                            alt={item.data.title || 'Product'}
                            className="w-16 h-16 object-cover rounded-md"
                          />
                        </div>
                      )}
                      
                      {/* Item Info */}
                      <div className="flex-1 min-w-0">
                        <h3 className="text-lg font-semibold text-gray-900 truncate">
                          {item.data.title || 'Untitled Item'}
                        </h3>
                        
                        {item.data.category && (
                          <p className="text-sm text-blue-600">
                            {item.data.category}
                          </p>
                        )}
                        
                        {item.data.specification?.desktop?.aspectRatio && (
                          <p className="text-sm text-gray-600">
                            Aspect Ratio: {item.data.specification.desktop.aspectRatio}
                          </p>
                        )}
                      </div>
                      
                      {/* Price */}
                      <div className="flex-shrink-0">
                        <span className="text-xl font-bold text-green-600">
                          ${item.data.price || '0.00'}
                        </span>
                      </div>
                    </div>
                  );
                }
                
                // Handle SampleItem items
                if ('title' in item) {
                  return (
                    <div 
                      key={item.id} 
                      className="flex items-center space-x-4 p-4 border border-gray-200 rounded-lg hover:shadow-md transition-shadow duration-200"
                    >
                      {/* Item Image */}
                      <div className="flex-shrink-0">
                        <img
                          src={item.image}
                          alt={item.title}
                          className="w-16 h-16 object-cover rounded-md"
                        />
                      </div>
                      
                      {/* Item Info */}
                      <div className="flex-1 min-w-0">
                        <h3 className="text-lg font-semibold text-gray-900 truncate">
                          {item.title}
                        </h3>
                        
                        <p className="text-sm text-blue-600">
                          {item.category}
                        </p>
                        
                        <p className="text-sm text-gray-600">
                          {item.description}
                        </p>
                      </div>
                      
                      {/* Price */}
                      <div className="flex-shrink-0">
                        <span className="text-xl font-bold text-green-600">
                          ${item.price}
                        </span>
                      </div>
                    </div>
                  );
                }
                
                return null;
              })}
            </div>
          </div>

          {/* Navigation Arrows */}
          {showNavigation && totalSlides > 1 && (
            <>
              {/* Previous Button */}
              <button
                onClick={goToPrevSlide}
                className="absolute left-0 top-1/2 transform -translate-y-1/2 -translate-x-12 bg-white border border-gray-300 rounded-full p-3 shadow-lg hover:shadow-xl transition-shadow duration-200"
                aria-label="Previous slide"
              >
                <svg className="w-6 h-6 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
                </svg>
              </button>

              {/* Next Button */}
              <button
                onClick={goToNextSlide}
                className="absolute right-0 top-1/2 transform -translate-y-1/2 translate-x-12 bg-white border border-gray-300 rounded-full p-3 shadow-lg hover:shadow-xl transition-shadow duration-200"
                aria-label="Next slide"
              >
                <svg className="w-6 h-6 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
                </svg>
              </button>
            </>
          )}
        </div>

        {/* Slide Indicators */}
        {totalSlides > 1 && (
          <div className="flex justify-center mt-6 space-x-2">
            {Array.from({ length: totalSlides }, (_, index) => (
              <button
                key={index}
                onClick={() => goToSlide(index)}
                className={`w-3 h-3 rounded-full transition-colors duration-200 ${
                  index === currentSlide
                    ? 'bg-blue-600'
                    : 'bg-gray-300 hover:bg-gray-400'
                }`}
                aria-label={`Go to slide ${index + 1}`}
              />
            ))}
          </div>
        )}

        {/* Slide Info */}
        <div className="text-center mt-4 text-sm text-gray-600">
          Slide {currentSlide + 1} of {totalSlides} 
          {displayItems.length > 0 && (
            <span className="ml-2">
              (Showing {getCurrentSlideItems().length} of {displayItems.length} items)
            </span>
          )}
        </div>
      </div>
    </div>
  );
};

export default VerticalCarousel;

```

 ![Screenshot 2025-09-03 at 7.29.59 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/c/cc470028ad966d982bb2e479fd253e344cfb1981.jpeg)

---

<div class="post-metadata">

**Author:** ![Dhanashree](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dhanashree](https://forum.builder.io/u/Dhanashree)\
**Post date:** [September 4, 2025, 9:14am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/7 "2025-09-04T09:14:48Z")

</div>

@manish-sharma Thanks! for your response.  
I would like to know if there is an option to achieve this using Builder only, without code or minimal coding?

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [September 9, 2025, 4:28pm UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/8 "2025-09-09T16:28:28Z")

</div>

> [@Dhanashree](#):
>
> I would like to know if there is an option to achieve this using Builder only, without code or minimal coding?

Hello @Dhanashree,

It may be possible to achieve this with custom CSS, but I’d recommend a simpler approach using Builder’s **AI Generate** option. You can quickly create a carousel with AI, and then save it as a **Symbol** for easy reuse across different content.

This way, you can minimize coding while still maintaining flexibility and consistency.

> **[Create and edit content with Visual Editor AI](https://www.builder.io/c/docs/vcp-create-content)**
>
> Learn how to use Builder.io's Visual Editor AI for content creation, editing, image generation, and mini-app development in the Visual Editor.

> **[Integrating Symbols](https://www.builder.io/c/docs/integrate-symbols)**
>
> Builder is an AI-Powered Visual Development Platform that helps teams generate, iterate, and optimize web and mobile experiences in seconds instead of sprints.

Thanks,

---

<div class="post-metadata">

**Author:** ![Dhanashree](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dhanashree](https://forum.builder.io/u/Dhanashree)\
**Post date:** [September 10, 2025, 7:09am UTC](https://forum.builder.io/t/testimonials-using-data-models/15720/9 "2025-09-10T07:09:31Z")

</div>

@manish-sharma  
Thank You!
