SThumbnail <s-thumbnail>
ts
import { SThumbnail } from 'polaris-vue-elements'Example
The images below load from picsum.photos, a third-party placeholder image service, purely for demo purposes.
vue
<script setup>
import { SThumbnail } from 'polaris-vue-elements'
</script>
<template>
<SThumbnail src="https://picsum.photos/seed/polaris-thumb/100" alt="Product photo" size="small" />
<SThumbnail src="https://picsum.photos/seed/polaris-thumb/100" alt="Product photo" size="base" />
<SThumbnail src="https://picsum.photos/seed/polaris-thumb/100" alt="Product photo" size="large" />
<!-- No src: renders a placeholder -->
<SThumbnail alt="Product photo not yet uploaded" size="base" />
</template>Props
| Prop | Type | Description |
|---|---|---|
alt | 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, 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 to learn more. |
size | "base" | "small" | "small-200" | "small-100" | "large" | "large-100" | Adjusts the size the product thumbnail image. |
src | 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. |
Events
| Event | Type |
|---|---|
error | CustomEvent |
load | CustomEvent |
Listen for these with @error-style listeners on <SThumbnail>.