Product Summary Image

Description

ProductSummaryImage is a VTEX Component that renders the product's image. This Component can be imported and used by any VTEX App.

📢 Disclaimer: Don't fork this project; use, contribute, or open issue with your feature request.

Table of Contents

Usage

You should follow the usage instruction in the main README.

Then, add product-summary-image block into your app theme, as we do in our Product Summary app.

Blocks API

This component has an interface that describes which rules must be implemented by a block when you want to use the ProductSummaryImage.

  "product-summary-image": {
    "component": "ProductSummaryImage"
  }

Configuration

Through the Storefront, you can change the ProductSummaryImage's behavior and interface. However, you also can make in your theme app.

Prop nameTypeDescriptionDefault value
showBadgeBooleanSet the discount badge's visibilitytrue
badgeTextStringText shown on badge
showCollectionsBooleanSet collection badges' visibilityfalse
displayModeEnumSet display mode of product summary (normal, inline)normal
hoverImageLabelStringSet this value to match the value of the imageLabel field of a product image, so this "secondary" image will be showed when user hovers its mouse over this component.""
width[ResponsiveInput<Number>](https://github.com/vtex-apps/responsive-values#vtexresponsive-values)Sets the image width.undefined
height[ResponsiveInput<Number>](https://github.com/vtex-apps/responsive-values#vtexresponsive-values)Sets the image height.undefined

Styles API

This app provides some CSS classes as an API for style customization.

To use this CSS API, you must add the styles builder and create an app styling CSS file.

  1. Add the styles builder to your manifest.json:
  "builders": {
    "styles": "1.x"
  }
  1. Create a file called vtex.product-summary.css inside the styles/css folder. Add your custom styles:
.imageContainer {
  margin-top: 10px;
}

CSS Handles

CSS HandlesDescriptionComponent Source
imageContainerThe main container of imageindex
imageNormalClass when display mode is normalindex
imageInlineClass when display mode is inlineindex
imageStackContainerClass for container with product images to be shownindex
hoverImageClass for image that appears when user hovers mouseindex
hoverEffectClass that applies hover effect and changes images. Override carefully.index