App blocks

Slider block

Developer reference for the deprecated Slider theme app block, its placement options, and every schema setting.

The Slider block is a theme app extension block that renders an upsell campaign as a horizontal carousel of product cards on your storefront. It is configured through the theme editor and powered by your campaign's Campaign ID.

The Slider block is deprecated. For new installations, use the Upsell Widget instead. This page documents the block for stores that still rely on it.

Purpose

The Slider block loads a campaign and displays its recommended products in a slider, letting shoppers add items to the cart directly from the carousel. It supports an optional quick view modal so shoppers can preview a product without leaving the page, and it can automatically refresh when the cart changes.

The block targets section, so you add it as a block inside an existing theme section from the theme editor.

Placement

By default the block renders inline, wherever you place it in the section. You can also render it inside a different element on the page by enabling Embed block.

When Embed block is on, the block is injected into the element matched by Embed selector (a CSS selector). The Placement setting controls where, relative to that target, the block is inserted. The four placement values map directly to the positions used by the DOM insertAdjacentElement API:

ValueLabelInserts the block…
beforebeginBefore the targetImmediately before the target element
afterendAfter the targetImmediately after the target element
afterbeginBefore the first child of the targetAs the first child inside the target
beforeendAfter the last child of the targetAs the last child inside the target

The default placement is afterbegin.

Screenshot: The Slider block settings panel open in the Shopify theme editorAdd a real image by setting the `src` prop.

Schema settings

All settings below come from the block's {% schema %}. The id is the setting key; the type is the Shopify setting type.

Campaign and embedding

IDTypeLabelDefaultNotes
widgetIdtextCampaign IDThe campaign to display. The Campaign ID is available in the Admin Panel.
isEmbedcheckboxEmbed blockfalseRender the block inside a given target instead of inline.
embedSelectortextEmbed selectorbodyCSS selector of the target where the block will be rendered.
whereradioPlacementafterbeginWhere to place the block relative to the target. See Placement.

Layout and behavior

IDTypeLabelDefaultNotes
cardLayoutselectProduct Card Layoutvertical or horizontal.
enableQuickViewcheckboxEnable quick viewfalseUse a modal to quickly preview a product.
enableRefreshOnCartChangecheckboxApp refresh on cart changetrueReload the block when the cart changes.
groupVariantscheckboxGroup variantstrueGroup a product's variants together.
hideOutOfStockcheckboxHide out of stock variantstrueHide variants that are out of stock.

Content

IDTypeLabelDefault
titletextHeading textYou may also like
addToCartTexttextAdd to cart button textAdd
addedToCartTexttextAdd to cart button text on item addedAdded

Sizes and spaces

The block exposes responsive sliders-per-view controls for desktop, tablet, and mobile, plus container padding for desktop and mobile.

IDTypeLabelDefaultNotes
slidesPerViewDesktoprangeSlides per view (desktop)4Range 110, step 1.
paddingDesktoptextContainer padding (desktop)0Accepts a CSS padding value, e.g. 16px 18px 12px 16px or 16px 14px.
slidesPerViewTabletrangeSlides per view (tablet)3Range 110, step 1.
slidesPerViewMobilerangeSlides per view (mobile)2Range 110, step 1.
paddingMobiletextContainer padding (mobile)0Accepts a CSS padding value, e.g. 16px 18px 12px 16px or 16px 14px.

Colors

IDTypeLabelDefault
backgroundColorcolorBackground Colorrgba(0,0,0,0)
fontColorcolorPrimary font color#121212
addToCartBgColorcolorAdd to cart button bg color#121212
addToCartTextColorcolorAdd to cart button font color#fff

Custom CSS

IDTypeLabelNotes
customCsstextareaCustom CSSFree-form CSS applied to the block, e.g. .app__product__image { border: 1px solid red; }

Example schema

The block declares its schema as a Shopify theme block. An excerpt looks like this:

{% schema %}
{
  "name": "Slider (Deprecated)",
  "target": "section",
  "javascript": "lcuSlider.js",
  "settings": [
    {
      "type": "text",
      "id": "widgetId",
      "label": "Campaign ID",
      "info": "Campaign ID is available in Admin Panel"
    }
  ]
}
{% endschema %}

The block targets section, runs the lcuSlider.js script, and (when Enable quick view is on) loads an additional quick view modal library.

On this page