A product option picker has a simple job: help shoppers understand what they are selecting. Text labels such as Black, Navy, or Sand work for basic products, but they become less useful when colour, material, texture, or finish makes a meaningful difference to the purchase.
Shopify has made this easier for developers working with its Catalog API. In an update published on November 19, 2026, Shopify introduced optional image swatches for product option values in the get_product response. Instead of relying entirely on a text label, a storefront can now display an image representing an option.
The change is small at the API level, but it creates new opportunities for product-page design. Developers can build more visual variant pickers while retaining the labels, selection states, and fallback behaviour shoppers still need.
This guide explains where the new data appears and how to use it in a responsive React component.
Quick Summary
- Shopify’s Catalog API can now return an optional
swatchobject for product option values.- The image URL is available at
product.options[].values[].swatch.image_url.- Swatches are returned by
get_product, notsearch_catalogorlookup_catalog.- A missing image does not mean an option is unavailable.
- Keep the option’s text label accessible, even when an image is displayed.
- Use the separate
availableandexistsfields to represent option states.- A responsive swatch picker should support keyboard interaction, visible selection feedback, and image-loading fallbacks.
What Are Shopify Image Swatches?
An image swatch is a visual representation of a product option. It allows shoppers to recognise a choice by looking at an image rather than interpreting its name alone.
Consider a product with a Color option containing Black, Navy, and Sand. A conventional picker might display three text buttons:
- Black
- Navy
- Sand
An image-based picker can display a small representative image for each colour, with the corresponding label available alongside it or to assistive technology.
This is useful for more than clothing. Product options can represent materials, patterns, surface finishes, furniture fabrics, accessories, and other characteristics that are easier to understand visually.
The new Shopify field gives developers a consistent place to retrieve these images from the product data. They no longer need to assume that an option’s image is stored in a variant’s options array.
What changed in the November 19 update?
Shopify added an optional swatch object to product option values returned by get_product.
The object contains one field:
{
"swatch": {
"image_url": "https://cdn.example.com/products/navy-swatch.png"
}
}
The image_url points to an image representing that particular option value.
Not every option has an image. If Shopify has no swatch data for a value, the response omits the swatch object. This is expected behaviour, not an API error.
Existing integrations also remain compatible. An application that does not read the new field can continue using its existing text-based picker.
Understand Where the Swatch Data Lives
Before changing a storefront component, it is important to understand which Catalog API operation returns the new field.
Shopify’s Global Catalog follows a discovery and evaluation flow:
search_cataloghelps discover products.lookup_catalogresolves known product or variant identifiers.get_productretrieves full product details and supports option selection.
The new image swatch data belongs to the third operation.
| Catalog operation | Returns option image swatches? |
|---|---|
search_catalog | No |
lookup_catalog | No |
get_product | Yes, when available |
This distinction matters when an application already has a product discovery workflow. A search response may contain product information and variants, but that does not mean it contains the option-level swatch images.
If your application needs to display image-based option selectors, retrieve the full product details using get_product.
Read the correct response path
The relevant data structure is:
product
└── options[]
└── values[]
├── label
├── available
├── exists
└── swatch
└── image_url
The image URL belongs to an individual option value. It is not a property of the product itself or a field inside a variant’s options array.
Here is a simplified response fragment:
{
"product": {
"options": [
{
"name": "Color",
"values": [
{
"label": "Black",
"available": true,
"exists": true,
"swatch": {
"image_url": "https://cdn.example.com/products/black-swatch.png"
}
},
{
"label": "Navy",
"available": true,
"exists": true,
"swatch": {
"image_url": "https://cdn.example.com/products/navy-swatch.png"
}
},
{
"label": "Sand",
"available": true,
"exists": true
}
]
}
]
}
}
This example illustrates three important cases:
- Black has a swatch image.
- Navy has a different swatch image.
- Sand has no
swatchobject.
Your frontend should handle all three without assuming that every option has an image.
Retrieve Product Details with get_product
The Global Catalog MCP reference documents get_product as the operation for retrieving full product details and refining a buyer’s option selection.
You need a product or variant identifier to make the request. The following example uses the UCP CLI syntax documented by Shopify:
ucp catalog get_product gid://shopify/Product/67890
You can also pass an existing selection:
ucp catalog get_product gid://shopify/Product/67890 \
--set '/selected/0={"name":"Color","label":"Black"}'
For a direct MCP request, the call uses the Catalog tool and places the product identifier inside the catalog object:
{
"catalog": {
"id": "gid://shopify/Product/67890",
"selected": [
{
"name": "Color",
"label": "Black"
}
]
}
}
The complete MCP request also includes the required JSON-RPC structure and UCP agent profile metadata. Use the profile and request configuration required by your integration.
Once the response arrives, read the option values from the returned product object:
const colorOption = product.options.find(
(option) => option.name === "Color"
);
const colorValues = colorOption?.values ?? [];
You can now pass those values to your storefront component.
One important implementation detail: selecting an option in the interface is not the same as completing variant selection. Your application still needs to use the selected option values with its product-selection workflow and process the matching variants returned by the API.
Build an Image-Based Variant Selector with React
Let’s turn the response into a practical product-page component.
The example uses a colour selector with image swatches. It supports:
- Images when
swatch.image_urlexists. - Text labels when an image is missing.
- A fallback when an image fails to load.
- A visible selected state.
- Separate availability and existence states.
- Accessible button labels.
The component expects an option object from the get_product response and a callback that passes the chosen value to the parent application.
1. Create the swatch component
import { useState } from "react";
function SwatchOption({
value,
selected,
onSelect
}) {
const [imageFailed, setImageFailed] = useState(false);
const imageUrl = value.swatch?.image_url;
const canSelect = value.available && value.exists;
const showImage = Boolean(imageUrl) && !imageFailed;
return (
<button
type="button"
className={`swatch-option ${
selected ? "is-selected" : ""
} ${!canSelect ? "is-unavailable" : ""}`}
aria-pressed={selected}
aria-label={`${value.label}${
!value.exists
? ", unavailable combination"
: !value.available
? ", currently unavailable"
: ""
}`}
disabled={!canSelect}
onClick={() => onSelect(value.label)}
>
{showImage ? (
<img
src={imageUrl}
alt=""
loading="lazy"
onError={() => setImageFailed(true)}
/>
) : (
<span className="swatch-label">
{value.label}
</span>
)}
</button>
);
}
export default SwatchOption;
The component checks for the image URL before rendering an image. If the URL is missing, it displays the text label instead.
The onError handler also handles a different situation: an image URL exists in the API response, but the browser cannot load the image. In that case, the component switches to the label without removing the option.
The image uses an empty alt attribute because the button already has an accessible name. This avoids unnecessarily announcing the same option name twice.
2. Render the product option values
The next component receives the product option and current selection from the parent.
import SwatchOption from "./SwatchOption";
function ProductColorPicker({
option,
selectedValue,
onSelect
}) {
if (!option) return null;
return (
<fieldset className="product-option">
<legend className="product-option-title">
{option.name}
</legend>
<div className="swatch-list">
{option.values.map((value) => (
<SwatchOption
key={value.label}
value={value}
selected={selectedValue === value.label}
onSelect={(label) => onSelect(option.name, label)}
/>
))}
</div>
<p className="selected-option">
Selected: {selectedValue || "Choose an option"}
</p>
</fieldset>
);
}
export default ProductColorPicker;
Using a fieldset and legend gives the group a meaningful accessible label. Each choice is a real button, so it supports normal keyboard activation without requiring custom keyboard event handlers.
The parent component owns the selection state. That is important because a colour selection may affect other product options, the displayed product media, the price, or the matching variant.
3. Add responsive CSS
The following styles create compact image swatches on larger screens and maintain usable touch targets on smaller devices.
.product-option {
border: 0;
padding: 0;
margin: 0;
}
.product-option-title {
font-size: 0.95rem;
font-weight: 600;
margin-bottom: 12px;
}
.swatch-list {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.swatch-option {
width: 56px;
height: 56px;
padding: 4px;
display: grid;
place-items: center;
border: 1px solid #d8dee5;
border-radius: 10px;
background: #fff;
cursor: pointer;
transition: border-color 160ms ease,
box-shadow 160ms ease;
}
.swatch-option img {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
border-radius: 6px;
}
.swatch-option.is-selected {
border: 2px solid #16a249;
box-shadow: 0 0 0 2px rgba(22, 162, 73, 0.14);
}
.swatch-option:focus-visible {
outline: 3px solid #16a249;
outline-offset: 3px;
}
.swatch-label {
font-size: 0.75rem;
line-height: 1.2;
text-align: center;
overflow-wrap: anywhere;
}
.swatch-option.is-unavailable {
opacity: 0.45;
cursor: not-allowed;
}
.selected-option {
margin-top: 12px;
font-size: 0.875rem;
color: #475569;
}
@media (max-width: 480px) {
.swatch-list {
gap: 10px;
}
.swatch-option {
width: 52px;
height: 52px;
}
}
The example keeps the swatch dimensions consistent, uses object-fit: cover to fit the image into its container, and provides a visible focus indicator.
For a production storefront, test the image crop against the actual swatch assets. A close-up fabric image, for example, may need a different presentation from a small product thumbnail.
Connect Selection to the Variant Workflow
Rendering the swatches is only one part of the implementation. A product page must also respond correctly when a shopper chooses a different option.
For example, a shopper might select Navy and then choose Size 10. The application needs to preserve both selections and resolve the matching variant.
The Catalog API supports passing selections to get_product through the selected array:
{
"catalog": {
"id": "gid://shopify/Product/67890",
"selected": [
{
"name": "Color",
"label": "Navy"
},
{
"name": "Size",
"label": "10"
}
]
}
}
The response reflects the effective selections in product.selected and returns variants matching those selections.
A practical frontend flow looks like this:
- Retrieve full product details with
get_product. - Render the product options and their available swatches.
- Store each selected option in application state.
- Send the updated selection to your product-selection workflow.
- Process the matching variants returned by the response.
- Update the product page with the resolved variant information.
Do not assume that selecting an image automatically changes the product variant. The image represents an option value; the application still needs to resolve the corresponding variant.
Handle Missing Images Without Breaking the Picker
A robust Shopify image swatches implementation must expect incomplete image data.
The swatch field is optional. Some values may have no image, and an image URL that was previously valid may later fail to load.
The correct approach is to preserve the option and its label.
| Situation | Recommended behaviour |
|---|---|
| Swatch image exists and loads | Display the image |
| Swatch object is missing | Display the text label |
| Image URL fails to load | Replace the image with the text label |
| Option exists and is available | Allow selection |
| Option exists but is unavailable | Show its unavailable state |
| Option does not exist for the current selection | Represent that state separately |
This separation is important because image availability and product availability describe different things.
Missing swatch does not mean unavailable
Consider a product with three colours:
- Black has a swatch image.
- Navy has no swatch image.
- Sand has a swatch image.
If Navy is available, it must remain selectable even though it has no image.
A common implementation mistake is to use the image URL as a condition for rendering the button:
// Avoid this approach
if (!value.swatch?.image_url) {
return null;
}
This hides valid product options simply because their visual metadata is missing.
Instead, use the option’s label for rendering and use the separate available and exists fields to determine its state.
The exact visual treatment of unavailable or non-existing combinations is a storefront decision. A disabled button, muted appearance, or explanatory message can work, provided shoppers can still understand what happened.
Preserve Accessibility in Image Swatches
An image can communicate colour or texture quickly, but it should not become the only way to identify an option.
A shopper using a screen reader still needs to know whether the selected choice is Black, Navy, or Sand. Someone browsing with a keyboard also needs a clear focus indicator and a predictable way to activate the control.
A few implementation details make a meaningful difference:
- Keep a text label visible or available to assistive technology.
- Use native buttons rather than clickable
divelements. - Group related options with
fieldsetandlegend. - Use
aria-pressedto communicate the selected state of each button. - Provide a visible
:focus-visiblestyle. - Do not rely on colour alone to show selection.
- Communicate unavailable states clearly.
- Use an empty image
altwhen the button already supplies the accessible name, avoiding duplicate announcements.
If the design uses image-only buttons, make sure each button still has a descriptive accessible name. A tooltip can help sighted users, but it is not a replacement for an accessible label.
Design a Responsive Product Swatch Picker
A good swatch component should feel natural on both desktop and mobile. The number of options, image dimensions, and product-page layout all affect the final design.
For a small number of colour choices, a horizontal row of swatches usually works well. When a product has many options, allow the layout to wrap rather than forcing the controls into a narrow line.
Consider these design decisions:
Consistent dimensions: Keep swatches within a predictable size range. This prevents one unusually shaped image from disrupting the entire picker.
Clear selection feedback: Use a border, outline, or another visible indicator. The selected state should remain recognizable without depending only on colour.
Touch-friendly controls: Avoid tiny clickable targets. A swatch should be comfortable to select on a phone.
Readable labels: Show the selected option name near the picker. This gives shoppers confirmation after making a choice.
Image cropping: Choose a consistent crop for the swatch images. If the image represents a material or pattern, avoid cropping away the details that distinguish it.
Flexible layout: Use wrapping or a deliberate grid when the available width becomes limited.
For larger catalogs, consider adding a text label or tooltip to each swatch so shoppers can inspect the options without guessing.
The goal is not to turn every product option into an image. It is to use images where they communicate something that text alone cannot.
Implementation Checklist
Before shipping the component, test the full product-selection flow rather than checking only whether the images appear.
- Retrieve option values through
get_product. - Read
product.options[].values[].swatch.image_url. - Do not expect swatches in
search_catalogorlookup_catalog. - Keep options visible when their
swatchobject is missing. - Provide a text fallback when an image fails to load.
- Keep accessible labels for every option.
- Use
availableandexistsfor option states. - Do not treat missing images as unavailable variants.
- Preserve selections when shoppers change multiple options.
- Resolve the matching variant after selection changes.
- Test keyboard navigation and screen-reader announcements.
- Check the picker at mobile, tablet, and desktop widths.
Final Thoughts
Shopify’s image swatches update gives developers another way to make product selection more visual without introducing a completely new variant-selection model.
The important part is understanding where the data lives. The optional swatch.image_url field belongs to product option values in get_product. It is not returned by catalog search or lookup, and it is not part of the variant’s options array.
Once that distinction is handled correctly, the frontend implementation is straightforward: display an image when one exists, retain the label when it does not, and keep availability separate from image data.
For Shopify developers and storefront designers, this is a useful improvement to product-page UX. The best implementations will combine the new visual information with accessible controls and a reliable variant-selection workflow.