Skip to main content

Image

Image is used for large format, responsive images.

Required< < string, < & > > >
required

The URL of the image. Supports the resolution and viewportInlineSize conditional styles only.

Anchor to accessibilityDescription
accessibilityDescription
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 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 to learn more.

Extract<, '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.

number

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.

<<>>

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.

<>

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.

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.

Was this section helpful?

Basic Image

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

Preview

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