Image
Image is used for large format, responsive images.
Anchor to imagepropsImageProps
- Anchor to sourcesourceRequired< < string, < & > > >required
The URL of the image. Supports the
resolution
andconditional styles only.
- Anchor to accessibilityDescriptionaccessibilityDescriptionstringDefault: ''
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both buyers using assistive technology and sighted buyers. A well written
description
provides people with visual impairments the ability to participate in consuming non-text content. When a screen readers encounters anImage
, the description is read and announced aloud. If an image fails to load, potentially due to a poor connection, thedescription
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 accessibilityRoleaccessibilityRoleExtract<, 'decorative'>
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help buyers navigate the page.
- Anchor to aspectRatioaspectRationumber
Displays the image at the specified aspect ratio (fills the width of the parent container and sets the height accordingly) and creates an invisible placeholder to prevent content jumping when the image loads. Use along with
fit
if the specified aspect ratio does not match the intrinsic aspect ratio to prevent the image from stretching.- Anchor to borderborder<<>>
Adjust the border style.
To shorten the code, it is possible to specify all the border style properties in one property.
For example:
base
means blockStart, inlineEnd, blockEnd and inlineStart border styles arebase
['base', 'none']
means blockStart and blockEnd border styles arebase
, inlineStart and inlineEnd border styles arenone
['base', 'none', 'dotted', 'base']
means blockStart border style isbase
, inlineEnd border style isnone
, blockEnd border style isdotted
and blockStart border style isbase
- Anchor to borderWidthborderWidth< <> >
Adjust the border width.
To shorten the code, it is possible to specify all the border width properties in one property.
For example:
base
means blockStart, inlineEnd, blockEnd and inlineStart border widths arebase
['base', 'medium']
means blockStart and blockEnd border widths arebase
, inlineStart and inlineEnd border widths aremedium
['base', 'medium', 'medium', 'base']
means blockStart border width isbase
, inlineEnd border width ismedium
, blockEnd border width ismedium
and blockStart border width isbase
- Anchor to cornerRadiuscornerRadius< <> >
Adjust the corner radius.
Provide a single value to apply the same corner radius to all four corners, two values to apply different corner radii to opposing corners, or four values to apply different corner radii to each individual corner.
For example:
base
means all 4 corner radii arebase
['base', 'none']
means the StartStart and EndEnd corner radii arebase
, StartEnd and EndStart corner radii arenone
. When the context’s language direction is left to right, StartStart and EndEnd corners are the top left and bottom right corners while StartEnd and EndStart corners are the top right and bottom left corners.['base', 'none', 'small', 'base']
means StartStart corner radius isbase
, StartEnd corner radius isnone
, EndEnd corner radius issmall
and EndStart corner radius isbase
A
alias is available for this property. When both are specified,
takes precedence.
- <>
Indicates how the image fits in its frame. Use if the image is not displayed at its intrinsic size to maintain the aspect ratio.
- string
A unique identifier for the component.
- Anchor to loadingloading
Indicates how the browser should load the image, either eager or lazy.
Uses native browser behavior and is not supported by all browsers. If no value is provided then the image is loaded immediately, regardless of whether or not the image is currently within the visible viewport.
ImageProps
- accessibilityDescription
An alternative text description that describe the image for the reader to understand what it is about. It is extremely useful for both buyers using assistive technology and sighted buyers. 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.
string
- accessibilityRole
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help buyers navigate the page.
Extract<AccessibilityRole, 'decorative'>
- aspectRatio
Displays the image at the specified aspect ratio (fills the width of the parent container and sets the height accordingly) and creates an invisible placeholder to prevent content jumping when the image loads. Use along with `fit` if the specified aspect ratio does not match the intrinsic aspect ratio to prevent the image from stretching.
number
- border
Adjust the border style. To shorten the code, it is possible to specify all the border style properties in one property. For example: - `base` means blockStart, inlineEnd, blockEnd and inlineStart border styles are `base` - `['base', 'none']` means blockStart and blockEnd border styles are `base`, inlineStart and inlineEnd border styles are `none` - `['base', 'none', 'dotted', 'base']` means blockStart border style is `base`, inlineEnd border style is `none`, blockEnd border style is `dotted` and blockStart border style is `base`
MaybeResponsiveConditionalStyle<MaybeShorthandProperty<BorderStyle>>
- borderRadius
MaybeResponsiveConditionalStyle< MaybeShorthandProperty<CornerRadius> >
- borderWidth
Adjust the border width. To shorten the code, it is possible to specify all the border width properties in one property. For example: - `base` means blockStart, inlineEnd, blockEnd and inlineStart border widths are `base` - `['base', 'medium']` means blockStart and blockEnd border widths are `base`, inlineStart and inlineEnd border widths are `medium` - `['base', 'medium', 'medium', 'base']` means blockStart border width is `base`, inlineEnd border width is `medium`, blockEnd border width is `medium` and blockStart border width is `base`
MaybeResponsiveConditionalStyle< MaybeShorthandProperty<BorderWidth> >
- cornerRadius
Adjust the corner radius. Provide a single value to apply the same corner radius to all four corners, two values to apply different corner radii to opposing corners, or four values to apply different corner radii to each individual corner. For example: - `base` means all 4 corner radii are `base` - `['base', 'none']` means the StartStart and EndEnd corner radii are `base`, StartEnd and EndStart corner radii are `none`. When the context’s language direction is left to right, StartStart and EndEnd corners are the top left and bottom right corners while StartEnd and EndStart corners are the top right and bottom left corners. - `['base', 'none', 'small', 'base']` means StartStart corner radius is `base`, StartEnd corner radius is `none`, EndEnd corner radius is `small` and EndStart corner radius is `base` A `borderRadius` alias is available for this property. When both are specified, `cornerRadius` takes precedence.
MaybeResponsiveConditionalStyle< MaybeShorthandProperty<CornerRadius> >
- fit
Indicates how the image fits in its frame. Use if the image is not displayed at its intrinsic size to maintain the aspect ratio.
MaybeResponsiveConditionalStyle<Fit>
- id
A unique identifier for the component.
string
- loading
Indicates how the browser should load the image, either eager or lazy. Uses native browser behavior and is not supported by all browsers. If no value is provided then the image is loaded immediately, regardless of whether or not the image is currently within the visible viewport.
Loading
- source
The URL of the image. Supports the `resolution` and `viewportInlineSize` conditional styles only.
Required< MaybeConditionalStyle< string, AtLeastOne<ViewportSizeCondition & ResolutionCondition> > >
export interface ImageProps extends BorderProps, CornerProps, IdProps {
/**
* The URL of the image. Supports the `resolution` and `viewportInlineSize` conditional styles only.
*/
source: Required<
MaybeConditionalStyle<
string,
AtLeastOne<ViewportSizeCondition & ResolutionCondition>
>
>;
/**
* An alternative text description that describe the image for the reader to
* understand what it is about. It is extremely useful for both buyers using
* assistive technology and sighted buyers. 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.
*
* @defaultValue ''
*/
accessibilityDescription?: string;
/**
* Indicates how the browser should load the image, either eager or lazy.
*
* Uses native browser behavior and is not supported by all browsers.
* If no value is provided then the image is loaded immediately, regardless of
* whether or not the image is currently within the visible viewport.
*/
loading?: Loading;
/**
* Displays the image at the specified aspect ratio (fills the width of the
* parent container and sets the height accordingly) and creates an invisible
* placeholder to prevent content jumping when the image loads. Use along
* with `fit` if the specified aspect ratio does not match the intrinsic
* aspect ratio to prevent the image from stretching.
*/
aspectRatio?: number;
/**
* Indicates how the image fits in its frame.
* Use if the image is not displayed at its intrinsic size to maintain
* the aspect ratio.
*/
fit?: MaybeResponsiveConditionalStyle<Fit>;
/**
* Sets the semantic meaning of the component’s content. When set,
* the role will be used by assistive technologies to help buyers
* navigate the page.
*/
accessibilityRole?: Extract<AccessibilityRole, 'decorative'>;
}
AccessibilityRole
'main' | 'header' | 'footer' | 'section' | 'complementary' | 'navigation' | 'orderedList' | 'listItem' | 'unorderedList' | 'separator' | 'status' | 'alert' | 'decorative' | 'presentation'
MaybeResponsiveConditionalStyle
A type that represents a value that can be a conditional style. The conditions are based on the viewport size. 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, ViewportSizeCondition>
ConditionalStyle
- conditionals
An array of conditional values.
ConditionalValue<T, AcceptedConditions>[]
- default
The default value applied when none of the conditional values specified in `conditionals` are met.
T
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;
}
ViewportSizeCondition
- viewportInlineSize
{ min: T; }
export interface ViewportSizeCondition<T = ViewportInlineSize> {
viewportInlineSize: {min: T};
}
MaybeShorthandProperty
T | ShorthandProperty<T>
ShorthandProperty
[T, T] | [T, T, T, T]
BorderStyle
'base' | 'dashed' | 'dotted' | 'none'
CornerRadius
'base' | 'small' | 'large' | 'fullyRounded' | 'none' | CornerRadiusDeprecated
CornerRadiusDeprecated
'tight' | 'loose'
BorderWidth
'base' | 'medium' | 'thick'
Fit
'cover' | 'contain'
Loading
'eager' | 'lazy'
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>
AtLeastOne
Partial<T> & U[keyof U]
ResolutionCondition
- resolution
Resolution
export interface ResolutionCondition {
resolution: Resolution;
}
Resolution
1 | 1.3 | 1.5 | 2 | 2.6 | 3 | 3.5 | 4
Basic Image
examples
Basic Image
React
import { reactExtension, Image, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => <Extension />, ); function Extension() { return ( <Image source="https://cdn.shopify.com/YOUR_IMAGE_HERE" /> ); }
JS
import {extension, Image} from '@shopify/ui-extensions/checkout'; export default extension('purchase.checkout.block.render', (root) => { const image = root.createComponent(Image, { source: 'https://cdn.shopify.com/YOUR_IMAGE_HERE', }); root.appendChild(image); });
Preview

Anchor to loadingLoading
Value | Description |
---|---|
"eager" | Image is loaded immediately, regardless of whether or not the image is currently within the visible viewport. |
"lazy" | Image is loaded when it’s within the visible viewport. |