Sliders & carousels

Shopify Carousel - Add a Product Slider to Your Store

Stefan Pakic4 min read

A carousel slider of cards moving across a web page

Shopify themes come with basic slideshow sections, but they're usually locked to one slide at a time with limited customization. If you want a carousel that shows multiple products, has touch swiping, or uses effects like coverflow or cards, you need something more.

This guide shows you how to add a carousel slider to Shopify using OneType Transforms - one script tag in your theme file and Custom Liquid sections for the carousel HTML. No Shopify app to install. For the full feature overview, see the main carousel slider guide.

You need a Shopify Basic plan or above. The Starter plan doesn't include an online store.

Step 1: Add the script tag to theme.liquid

  1. Go to Online Store > Themes
  2. Click the three dots on your active theme > Edit code
  3. Open Layout > theme.liquid
  4. Find </head> (use Ctrl+F)
  5. Paste the script tag directly above it
  6. Click Save
<script src="https://cdn.transforms.onetype.ai/bundle/{YOUR-TOKEN}.js" defer></script>

Get your token at transforms.onetype.ai/get-started. The defer attribute is Shopify's best practice - it downloads the script immediately but runs it after HTML parsing.

Tip: Duplicate your theme before editing (Theme actions > Duplicate) to have a backup.

Step 2: Add the carousel to any page

Using the Theme Editor (no code editing):

  1. Go to Online Store > Themes > Customize
  2. Select the page you want (Homepage, Product, Collection, etc.)
  3. Click Add section > Custom Liquid
  4. Paste the carousel HTML in the Liquid code field
  5. Drag the section to position it
  6. Click Save
<div ot="swiper" ot-navigation="true" ot-pagination="bullets" ot-autoplay="true" ot-loop="true">
    <div><img src="https://cdn.shopify.com/your-image-1.jpg" alt="Product 1"></div>
    <div><img src="https://cdn.shopify.com/your-image-2.jpg" alt="Product 2"></div>
    <div><img src="https://cdn.shopify.com/your-image-3.jpg" alt="Product 3"></div>
</div>

Product card carousel:

<div ot="swiper" ot-slides-per-view="3" ot-space-between="20" ot-navigation="true" ot-grab-cursor="true">
    <div class="product-card">
        <img src="product-1.jpg" alt="Product 1">
        <h3>Product Name</h3>
        <p>$29.99</p>
    </div>
    <div class="product-card">
        <img src="product-2.jpg" alt="Product 2">
        <h3>Product Name</h3>
        <p>$39.99</p>
    </div>
    <div class="product-card">
        <img src="product-3.jpg" alt="Product 3">
        <h3>Product Name</h3>
        <p>$49.99</p>
    </div>
    <div class="product-card">
        <img src="product-4.jpg" alt="Product 4">
        <h3>Product Name</h3>
        <p>$59.99</p>
    </div>
</div>

Hero banner with autoplay:

<div ot="swiper" ot-effect="fade" ot-autoplay="true" ot-autoplay-delay="4000" ot-loop="true" ot-pagination="progressbar">
    <div><img src="banner-1.jpg" alt="Summer Sale" style="width:100%;"></div>
    <div><img src="banner-2.jpg" alt="New Arrivals" style="width:100%;"></div>
    <div><img src="banner-3.jpg" alt="Free Shipping" style="width:100%;"></div>
</div>

Using Liquid for dynamic carousels

Since Custom Liquid sections support Shopify's Liquid templating, you can build dynamic carousels that pull from your store data. For example, a carousel of products from a specific collection:

<div ot="swiper" ot-slides-per-view="3" ot-space-between="20" ot-navigation="true">
    {% for product in collections.featured.products limit: 8 %}
    <div>
        <img src="{{ product.featured_image | image_url: width: 400 }}" alt="{{ product.title }}">
        <p>{{ product.title }}</p>
        <p>{{ product.price | money }}</p>
    </div>
    {% endfor %}
</div>

This pulls up to 8 products from your "featured" collection and creates a slide for each one. The carousel updates automatically when you change the collection.

Important notes

  • Editing theme.liquid directly means changes may be lost on theme updates - always duplicate first
  • Custom Liquid sections added via the Theme Editor survive theme updates
  • The carousel does not work on checkout pages (Shopify restriction)
  • No CSP issues - Shopify storefronts allow third-party CDN scripts

For the full list of options and effects, see the complete carousel slider guide. Explore all transforms at transforms.onetype.ai.

More posts

All

Build it today. Pay when it goes live.

Every feature is unmetered while you build.

Start building