Skip to content

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 ​

PropTypeDescription
altstringAn 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-200" | "small-100" | "small" | "large" | "large-100"The size of the product thumbnail image. - small-200: Smallest thumbnail size, ideal for compact product lists or tables. - small-100: Very small thumbnail, suitable for dense layouts. - small: Small thumbnail for space-constrained contexts. - base: Default size that balances visibility and space efficiency. - large: Larger thumbnail for featured products or detailed views. - large-100: Extra large thumbnail for prominent product display.
srcstringThe 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 ​

EventType
errorCustomEvent
loadCustomEvent

Listen for these with @error-style listeners on <SThumbnail>.

Released under the MIT License.