Image is used for large format, responsive images.
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" />
);
}
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);
});
The URL or path to the image. Supports the `resolution` and `viewportInlineSize` conditional styles only.
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.
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.
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.
Indicates how the image fits in its frame. Use if the image is not displayed at its intrinsic size to maintain the aspect ratio.
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.
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`
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`
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.
A unique identifier for the component.
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>
The default value applied when none of the conditional values specified in `conditionals` are met.
An array of conditional values.
The conditions that must be met for the value to be applied. At least one condition must be specified.
The value that will be applied if the conditions are met.
Partial<T> & U[keyof U]
'small' | 'medium' | 'large'
1 | 1.3 | 1.5 | 2 | 2.6 | 3 | 3.5 | 4
'eager' | 'lazy'
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>
'cover' | 'contain'
'main' | 'header' | 'footer' | 'section' | 'complementary' | 'navigation' | 'orderedList' | 'listItem' | 'unorderedList' | 'separator' | 'status' | 'alert' | 'decorative' | 'presentation'
T | ShorthandProperty<T>
[T, T] | [T, T, T, T]
'base' | 'dotted' | 'none'
'base' | 'medium'
'base' | 'small' | 'large' | 'fullyRounded' | 'none' | CornerRadiusDeprecated
'tight' | 'loose'