Docs
Page templatesProduct page

Variant swatches

Variant swatches in Local: show color or image swatches for variant options from Shopify category metafields or from your own metaobjects.

Applies to: Local 4.2.1 and later. Added in: Local 2.4.1. Last checked: 2026-10-13 against Local 4.2.1.

Variant swatches show a small color or image next to each option value in the variant picker, for example a red dot next to "Red" or a fabric photo next to "Silk". Local takes them from Shopify's category metafields, or from metaobjects you create for options that Shopify has no swatches for.

Where to find it: in the theme editor, open Products → Default product → Product page and select the Variant picker block.

Theme editor on the Default product template: the Variant picker block with Variants selector type Blocks and Metaobject swatch metafields set to custom.materials_list,custom.cru_new, beside a product with image and color swatches for Colors, Materials and CRU.

Which swatches Local can show

  • Shopify swatches come from category metafields, for example the Color metafield of a product category. Shopify gives each color value a swatch color or image, and Local shows it on the option button. Nothing to set in the theme.
  • Metaobject swatches come from your own metaobject entries, for options such as Material, Pattern or Roast. You create the entries in Shopify admin and type the product metafield in the Variant picker block's Metaobject swatch metafields setting (steps below).

Both need Variants selector type set to Blocks. The option value's name always shows next to the swatch.

This option to display image or color swatches for variant options using metaobjects is available for Product page, Featured product and Quick view sections.

The Event ticket section's variant picker has no Metaobject swatch metafields setting.

Swatch priority

For each option value, Local uses the first swatch it finds, in this order:

  1. The Shopify swatch image (category metafields).
  2. The Shopify swatch color (category metafields).
  3. The metaobject image.
  4. The metaobject color.

When none is found, the option shows as a plain text button.

You don't have to use both images and colors. Both types are available, but you can decide if you want to use only one (image always takes priority).

Setting up metaobject swatches

The example below adds swatches to a "Materials" option. Repeat it for each option that needs swatches.

Create a metaobject definition

In Shopify admin, open Settings → Metafields and metaobjects → Metaobject definitions and select Add definition. Name it, for example "Materials list", and add these fields, each with one value:

  • Label: Single line text.
  • Image: File, images only. Optional.
  • Color: Color. Optional.

Add at least an image or a color.

Shopify admin metaobject definition Materials list (type materials_list) with three fields: Label (Single line text), Image (Image (File)) and Color (Color).

Create one entry per option value

Open Content → Metaobjects, select your definition and add one entry per value, for example Label "Silk" with a color or an image.

Shopify admin metaobject entry Silk under Content → Metaobjects: Label Silk, Image Organic.png and Color #C7EF71.

Create a product metafield that lists the entries

Open Settings → Metafields and metaobjects → Products and select Add definition. Name it, for example "Materials list" (custom.materials_list), choose the type Metaobject, select your definition and select List of entries. The list is required: the theme reads a list.

Shopify admin product metafield definition Materials list (custom.materials_list) of type List of Materials list metaobject entries, used as a variant option on 3 products.

Fill the metafield on the product

Open the product, find the new metafield under Metafields and add the entries that its variants use.

Product page in Shopify admin: the Product metafields card with the Materials list metafield holding the entries Silk and Wool.

Add the option to the product

In the product's Variants card, select Add options and choose your metafield from the recommended list. Shopify fills the option values from the entries, so their names match the labels.

Shopify admin product Variants card: the Add another option list with Materials list among the suggested metafield-linked options.

Configure the theme

In the theme editor, open Products → Default product → Product page and select the Variant picker block. Set Variants selector type to Blocks and type custom.materials_list in Metaobject swatch metafields. For several metafields, separate them with commas: custom.materials_list, custom.colors. Select Save.

Type the same metafields in the Variant picker block of each Featured product section and of the Quick view popup (template picker → Products → quick-view), so product cards' quick buy shows the swatches too.

Make sure these fields are created exactly as specified above, as the theme relies on this structure to correctly render swatches.

How Local matches labels to option values

  • Each option value is compared with the Label of the entries, exactly: "Silk" does not match "silk" or "Silk fabric". Spaces at the start and end of the label are ignored.
  • With several metafields in the setting, the first metafield that has a matching label wins.
  • An option value without a matching entry shows as a plain text button.

Make sure each Label value is unique across the metaobject entries, so that swatches are always displayed correctly.

Why does my option show text instead of a swatch?

Because Local found no swatch for that value. Check these points in order:

  • Variants selector type is Blocks, not Dropdown.
  • The product metafield is typed in Metaobject swatch metafields, as namespace.key, in the template the product uses.
  • The metafield is a List of entries and holds an entry for this value on this product.
  • The entry's Label matches the option value exactly, including capitals.
  • The entry has an Image or a Color.

Do swatches work with the dropdown picker?

No. With Variants selector type set to Dropdown, the variant picker shows plain text choices, for Shopify swatches and metaobject swatches alike. Set it to Blocks to show swatches.

On this page