Product Thumbnail
Use ProductThumbnail to display a product thumbnail
Anchor to propertiesProperties
- stringDefault: `''`
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
s-image
, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, thealt
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.- Anchor to sizesize'small' | 'base' | 'small-100'
Adjusts the size the product thumbnail image.
- Anchor to sizessizesstring
A set of media conditions and their corresponding sizes.
- string
The image source (either a remote URL or a local file resource).
When the image is loading or no
src
is provided, a placeholder will be rendered.- Anchor to srcSetsrcSetstring
A set of image sources and their width or pixel density descriptors.
This overrides the
src
property.- Anchor to totalItemstotalItemsnumber
Decorates the product thumbnail with the quantity of the product.
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 `s-image`, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, the `alt` 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://www.shopify.com/ca/blog/image-alt-text#4) to learn more.
string
- size
Adjusts the size the product thumbnail image.
'small' | 'base' | 'small-100'
- sizes
A set of media conditions and their corresponding sizes.
string
- src
The image source (either a remote URL or a local file resource). When the image is loading or no `src` is provided, a placeholder will be rendered.
string
- srcSet
A set of image sources and their width or pixel density descriptors. This overrides the `src` property.
string
- totalItems
Decorates the product thumbnail with the quantity of the product.
number
export interface ProductThumbnailProps extends Pick<ProductThumbnailProps$1, 'alt' | 'size' | 'sizes' | 'src' | 'srcSet' | 'totalItems'> {
size?: Extract<ProductThumbnailProps$1['size'], 'small-100' | 'small' | 'base'>;
}
Code
examples
Code
<s-product-thumbnail src="https://cdn.shopify.com/YOUR_IMAGE_HERE" totalitems="1" ></s-product-thumbnail>
Preview
