> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frenzy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Swiper

> Let shoppers swipe through the product images inside each card.

The image swiper turns the card image into a small gallery: shoppers swipe on mobile, or use arrows and dots on desktop, to see the other images of the product without opening it.

> [!WARNING]
>
> The image swiper needs the new product cards: `window.useNewProductCards = true`. See [Overview](https://docs.frenzy.ai/shopify-app/configuring-product-card/overview.md).

## How to activate the swiper

Set `type: 'swiper'` in `window.productCardOptions`. Add it in the Frenzy callback file, `assets/frenzy-callback-function.js`.

```js assets/frenzy-callback-function.js theme={null}
window.productCardOptions = {
  type: 'swiper'
};
```

That is all you need: the swiper uses the default values below. The card template must have the main image with the class `frenzy_img_first`; the swiper is drawn in its place.

```html theme={null}
<a href="[[product_url]]" class="frenzy_product_image">
  <img class="frenzy_img_first" src="[[product_featured_image]]" alt="[[product_title]]">
  <img class="frenzy_img_second" src="[[product_second_image]]" alt="[[product_title]]">
</a>
```

The swiper is shown on collection pages, the search results page and, if enabled, in recommendation carousels. It is not shown in the search suggestions dropdown.

## Options

Pass them in `swiperOptions`. None are required: a key that is not set keeps its default value.

| Option | Default | Description |
| - | - | - |
| `mobileOnly` | `false` | Swiper only below 1024px. |
| `desktopOnly` | `false` | Swiper only on screens 768px or wider. |
| `progressBar` | `true` | Progress bar at the top of the image. |
| `showArrows` | `true` | Previous / next arrows on desktop. |
| `loop` | `true` | `false` stops at the first and last image instead of going around. |
| `showDotsDesktop` | `false` | Dots on screens 768px or wider. |
| `showDotsMobile` | `false` | Dots on screens below 768px. |
| `enableInCarousels` | `false` | Enables the swiper in all Frenzy recommendation carousels: home, product page, cart page and cart drawer. See [Recommendation Carousels](https://docs.frenzy.ai/shopify-app/configuring-product-card/recommendation-carousels.md). |
| `cart.showArrows` | `false` | Arrows in the cart drawer. Needs `enableInCarousels`. |
| `cart.showDotsDesktop` / `cart.showDotsMobile` | `true` | Dots in the cart drawer. Needs `enableInCarousels`. |

> [!NOTE]
>
> When the swiper is active, the secondary image on hover is turned off. To show a different image on hover for each slide, use `hoverVariantImages` in the swatches (see [Swatches](https://docs.frenzy.ai/shopify-app/configuring-product-card/swatches.md#what-loadswatches-returns)).

## Example

### Swiper on mobile only, with dots and no loop

```js assets/frenzy-callback-function.js theme={null}
window.productCardOptions = {
  type: 'swiper',
  swiperOptions: {
    mobileOnly: true,
    showDotsMobile: true,
    loop: false
  }
};
```

## How to get images for the swiper

The swiper shows a list of images:

* **Cards without swatches:** all the product images synced to Frenzy, in the same order as in Shopify. To change them, change the product media in Shopify admin and wait for the next product sync.
* **Cards with swatches:** the `variantImages` of the selected swatch. They change when the shopper selects another color.

The variant data that Frenzy sends has only one image per variant. To show every image of each color, get them from Shopify as in [Swatches – Example 2](https://docs.frenzy.ai/shopify-app/configuring-product-card/swatches.md#example-2-get-all-the-images-of-each-color-from-shopify).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.