Skip to main content

ProductThumbnail

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
Default: `''`

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, accessibilityLabel takes precedence.

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 accessibilityLabel for compatibility with the HTML specification. When both are specified accessibilityLabel takes precedence.

number

Decorates the product thumbnail with the quantity of the product.

Extract<, 'base' | 'small'>
Default: 'base'

Adjusts the size the product thumbnail image.

<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.

Was this section helpful?

Basic ProductThumbnail

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}
/>
);
}

Preview

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).
Was this section helpful?