App blocks

List block

Developer reference for the deprecated List app block, its placement, and every schema setting.

The List app block renders an upsell list of recommended products from a campaign. It is a Shopify theme app extension block targeted at the section level, and it can either render in place or inject itself into any element on the page using a CSS selector.

This block is deprecated. The schema name is List (Deprecated) and it is only available when the customizer_2024_02 deprecation metafield is present. For new installs, use the Upsell Widget block instead.

Overview

The block loads the campaign list runtime through a shared loader and, when quick view is enabled, also injects the quick view modal script.

{% render 'lib-loader' with block, settings: block.settings, name: 'lcuList' %}

{% if block.settings.enableQuickView %}
  {% render 'inject-unique-lib', name: 'lcuQuickViewModal.js' %}
{% endif %}

Key facts from the {% schema %}:

  • Name: List (Deprecated)
  • Target: section
  • JavaScript: lcuList.js
  • Available if: {{ app.metafields.deprecation.customizer_2024_02 }}

Placement

By default the block renders where you add it in the theme editor. To render it somewhere else on the page instead, enable Embed block and provide a CSS selector for the target element, plus a placement relative to that target.

The where setting maps directly to the positions accepted by the DOM insertAdjacentElement API:

ValueLabelPosition relative to the target
beforebeginBefore the targetImmediately before the target element
afterendAfter the targetImmediately after the target element
afterbeginBefore the first child of the targetInside the target, before its first child
beforeendAfter the last child of the targetInside the target, after its last child

The default placement is afterbegin.

Schema settings

All settings live in the settings array of the block's {% schema %}. They are grouped under headers in the theme editor.

General

IDTypeLabelDefaultNotes
widgetIdtextCampaign IDThe campaign to render. The Campaign ID is available in the Admin Panel.
isEmbedcheckboxEmbed blockfalseRender the block inside a given target instead of in place.
embedSelectortextEmbed selectorbodyCSS selector of the target where the block will be rendered.
whereradioPlacementafterbeginWhere to place the block relative to the target. See Placement.
enableQuickViewcheckboxEnable quick viewfalseUse a modal to quickly preview a product. Loads lcuQuickViewModal.js when enabled.
enableRefreshOnCartChangecheckboxApp refresh on cart changetrueRefresh the block when the cart changes.

Content

IDTypeLabelDefaultNotes
titletextHeading textYou may also likeHeading shown above the product list.
addToCartTexttextAdd to cart button textAddLabel for the add to cart button.
addedToCartTexttextAdd to cart button text on item addedAddedLabel shown after an item is added to the cart.
groupVariantscheckboxGroup variantstrueGroup a product's variants together.
hideOutOfStockcheckboxHide out of stock variantstrueHide variants that are out of stock.

Sizes and spaces

IDTypeLabelDefaultRangeNotes
productPlaceholdersCountrangeProduct placeholders count41–4, step 1Number of loading placeholders shown while products load.
productImageSizeDesktoprangeProduct image size8010–200, step 2 (px)Product image size in pixels.
paddingDesktoptextContainer padding8pxSpace around the container. Accepts any CSS padding value, e.g. 16px 18px 12px 16px or 16px 14px.

Styles

IDTypeLabelDefaultNotes
fontColorcolorPrimary font color#121212Primary text color.
backgroundColorcolorBackground Colorrgba(0,0,0,0)Container background color (transparent by default).
addToCartBgColorcolorAdd to cart button bg color#121212Background color of the add to cart button.
addToCartTextColorcolorAdd to cart button font color#fffText color of the add to cart button.
customCsstextareaCustom CSSCustom CSS for fine-grained styling, e.g. .app__product__image { border: 1px solid red; }.

Color values follow Shopify's color setting format, so you can use hex or rgba() values. The backgroundColor default of rgba(0,0,0,0) makes the container transparent so it inherits the surrounding theme background.

Example configuration

A minimal embedded configuration that injects the list after the last child of the cart drawer might be saved as block settings like this:

{
  "widgetId": "your-campaign-id",
  "isEmbed": true,
  "embedSelector": ".cart-drawer__content",
  "where": "beforeend",
  "title": "Complete your order",
  "addToCartText": "Add",
  "addedToCartText": "Added"
}
Screenshot: Theme editor showing the List block settings grouped under General, Content, Sizes and spaces, and Styles headersAdd a real image by setting the `src` prop.
The List block settings as they appear in the Shopify theme editor.

On this page