Thumbnail
Display a small preview image representing content, products, or media.
Anchor to propertiesProperties
- 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
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" | "small-200" | "small-100" | "base" | "large" | "large-100"
Adjusts the size the product thumbnail image.
- 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 eventsEvents
Learn more about registering events.
- Anchor to errorerrorOnErrorEventHandler
- Anchor to loadloadCallbackEventListener<typeof tagName> | null
CallbackEventListener
(EventListener & {
(event: CallbackEvent<T>): void;
}) | null
CallbackEvent
Event & {
currentTarget: HTMLElementTagNameMap[T];
}
Code
Examples
Code
Default
<s-thumbnail alt="White sneakers" src="/assets/products/sneakers.jpg"> </s-thumbnail>