Product Thumbnail
Product thumbnail is a representation of a product image. It provides a visual preview of the item, so buyers can quickly identify products.
Anchor to productthumbnailpropsProductThumbnailProps
- string
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both users using assistive technology and sighted users. A well written description provides people with visual impairments the ability to participate in consuming non-text content. When a screen readers encounters an
Image
, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, the description is displayed on screen instead. This has the benefit of letting a sighted buyer know an image was meant to load here, but as an alternative, they’re still able to consume the text content. Read considerations when writing alternative text to learn more.This property is an alias for
for compatibility with the HTML specification. When both are specified
takes precedence.
- Anchor to accessibilityLabelaccessibilityLabelstringDefault: `''`
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both users using assistive technology and sighted users. A well written description provides people with visual impairments the ability to participate in consuming non-text content. When a screen readers encounters an
Image
, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, the description is displayed on screen instead. This has the benefit of letting a sighted buyer know an image was meant to load here, but as an alternative, they’re still able to consume the text content. Read considerations when writing alternative text to learn more.An
alt
property is available as an alias for this for compatibility with the HTML specification. When both are specified,takes precedence.
- Anchor to sourcesource<string, >
The image source (either a remote URL or a local file resource).
A
src
property is available as an alias for this for compatibility with the HTML specification. When both are specified,source
takes precedence.- <string, >
The image source (either a remote URL or a local file resource).
This property is available as an alias for
source
for compatibility with the HTML specification. When both are specified,source
takes precedence.- Anchor to badgebadgenumber
Decorates the product thumbnail with the quantity of the product.
- Anchor to sizesizeExtract<, 'base' | 'small'>Default: 'base'
Adjusts the size the product thumbnail image.
ProductThumbnailProps
- alt
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both users using assistive technology and sighted users. A well written description provides people with visual impairments the ability to participate in consuming non-text content. When a screen readers encounters an `Image`, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, the description is displayed on screen instead. This has the benefit of letting a sighted buyer know an image was meant to load here, but as an alternative, they’re still able to consume the text content. Read [considerations when writing alternative text](https://ux.shopify.com/considerations-when-writing-alt-text-a9c1985a8204) to learn more. This property is an alias for `accessibilityLabel` for compatibility with the HTML specification. When both are specified `accessibilityLabel` takes precedence.
string
- accessibilityLabel
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both users using assistive technology and sighted users. A well written description provides people with visual impairments the ability to participate in consuming non-text content. When a screen readers encounters an `Image`, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, the description is displayed on screen instead. This has the benefit of letting a sighted buyer know an image was meant to load here, but as an alternative, they’re still able to consume the text content. Read [considerations when writing alternative text](https://ux.shopify.com/considerations-when-writing-alt-text-a9c1985a8204) to learn more. An `alt` property is available as an alias for this for compatibility with the HTML specification. When both are specified, `accessibilityLabel` takes precedence.
string
- source
The image source (either a remote URL or a local file resource). A `src` property is available as an alias for this for compatibility with the HTML specification. When both are specified, `source` takes precedence.
MaybeConditionalStyle<string, ResolutionCondition>
- src
The image source (either a remote URL or a local file resource). This property is available as an alias for `source` for compatibility with the HTML specification. When both are specified, `source` takes precedence.
MaybeConditionalStyle<string, ResolutionCondition>
- badge
Decorates the product thumbnail with the quantity of the product.
number
- size
Adjusts the size the product thumbnail image.
Extract<Size, 'base' | 'small'>
export interface ProductThumbnailProps {
/**
* An alternative text description that describe the image for the reader to
* understand what it is about. It is extremely useful for both users using
* assistive technology and sighted users. A well written description
* provides people with visual impairments the ability to participate in
* consuming non-text content. When a screen readers encounters an `Image`,
* the description is read and announced aloud. If an image fails to load,
* potentially due to a poor connection, the description is displayed on
* screen instead. This has the benefit of letting a sighted buyer know an
* image was meant to load here, but as an alternative, they’re still able to
* consume the text content. Read
* [considerations when writing alternative text](https://ux.shopify.com/considerations-when-writing-alt-text-a9c1985a8204)
* to learn more.
*
* This property is an alias for `accessibilityLabel` for compatibility with the HTML
* specification. When both are specified `accessibilityLabel` takes precedence.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#alt
*/
alt?: string;
/**
* An alternative text description that describe the image for the reader to
* understand what it is about. It is extremely useful for both users using
* assistive technology and sighted users. A well written description
* provides people with visual impairments the ability to participate in
* consuming non-text content. When a screen readers encounters an `Image`,
* the description is read and announced aloud. If an image fails to load,
* potentially due to a poor connection, the description is displayed on
* screen instead. This has the benefit of letting a sighted buyer know an
* image was meant to load here, but as an alternative, they’re still able to
* consume the text content. Read
* [considerations when writing alternative text](https://ux.shopify.com/considerations-when-writing-alt-text-a9c1985a8204)
* to learn more.
*
* An `alt` property is available as an alias for this for compatibility with the HTML
* specification. When both are specified, `accessibilityLabel` takes precedence.
*
* @defaultValue `''`
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#alt
*/
accessibilityLabel?: string;
/**
* The image source (either a remote URL or a local file resource).
*
* A `src` property is available as an alias for this for compatibility with the HTML
* specification. When both are specified, `source` takes precedence.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#src
*/
source?: MaybeConditionalStyle<string, ResolutionCondition>;
/**
* The image source (either a remote URL or a local file resource).
*
* This property is available as an alias for `source` for compatibility with the HTML
* specification. When both are specified, `source` takes precedence.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#src
*/
src?: MaybeConditionalStyle<string, ResolutionCondition>;
/**
* Decorates the product thumbnail with the quantity of the product.
*/
badge?: number;
/**
* Adjusts the size the product thumbnail image.
*
* @defaultValue 'base'
*/
size?: Extract<Size, 'base' | 'small'>;
}
MaybeConditionalStyle
A type that represents a value that can be a conditional style. We highly recommend using the `Style` helper which simplifies the creation of conditional styles. To learn more check out the [conditional styles](/api/checkout-ui-extensions/components/utilities/stylehelper) documentation.
T | ConditionalStyle<T, AcceptedConditions>
ConditionalStyle
- default
The default value applied when none of the conditional values specified in `conditionals` are met.
T
- conditionals
An array of conditional values.
ConditionalValue<T, AcceptedConditions>[]
export interface ConditionalStyle<
T,
AcceptedConditions extends BaseConditions = Conditions,
> {
/**
* The default value applied when none of the conditional values
* specified in `conditionals` are met.
*/
default?: T;
/**
* An array of conditional values.
*/
conditionals: ConditionalValue<T, AcceptedConditions>[];
}
ConditionalValue
- conditions
The conditions that must be met for the value to be applied. At least one condition must be specified.
AcceptedConditions
- value
The value that will be applied if the conditions are met.
T
export interface ConditionalValue<
T,
AcceptedConditions extends BaseConditions = Conditions,
> {
/**
* The conditions that must be met for the value to be applied. At least one
* condition must be specified.
*/
conditions: AcceptedConditions;
/**
* The value that will be applied if the conditions are met.
*/
value: T;
}
ResolutionCondition
- resolution
Resolution
export interface ResolutionCondition {
resolution: Resolution;
}
Resolution
1 | 1.3 | 1.5 | 2 | 2.6 | 3 | 3.5 | 4
Size
'extraSmall' | 'small' | 'base' | 'large' | 'extraLarge' | 'fill'
Basic ProductThumbnail
examples
Basic ProductThumbnail
React
import { reactExtension, ProductThumbnail, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => <Extension />, ); function Extension() { return ( <ProductThumbnail source="/assets/api/checkout-extensions/checkout/components/product-thumbnail-example-code.png" badge={2} /> ); }
JS
import {extension, ProductThumbnail} from '@shopify/ui-extensions/checkout'; export default extension('purchase.checkout.block.render', (root) => { const paymentIcon = root.createComponent(ProductThumbnail, { source: '/assets/api/checkout-extensions/checkout/components/product-thumbnail-example-code.png', badge: 2, }); root.appendChild(paymentIcon); });
Preview

Anchor to best-practicesBest Practices
High-quality images and consistent aspect ratio
- Use optimized product images that ensure visual clarity and loading speed. Maintain a consistent aspect ratio for product thumbnails to avoid distortion or stretching of the images.
Consistent visual style and appropriate sizes
- Keep a consistent visual style for product thumbnails throughout your store. Use appropriate size for product thumbnails depending on the layout and use case. This consistency helps buyers recognize and associate the thumbnails with your product offerings.
Accessibility considerations
- Ensure product thumbnails are accessible with descriptive alternative text (alt text).