Skip to content
vviinn DocsDocs Beta

Product Card (vviinn-product-card)

Card for one search result or recommendation. Renders a product, a content entry or a list entry, depending on entity-type.

Generated from vviinn-widgets 2.228.0, the latest release when these docs were built. If you pin an older version, some of these may not be in it yet — check the Changelog.

Try the properties live in the Playground.

Set them as HTML attributes.

add-price-container

Wrap the Product Card's price values in the container.

Type: boolean · Default: false

add-to-basket-show

Show or hide the Add to Basket button

Type: boolean

base-price

Price per unit, as an object or a JSON string: {"price": 9.99, "quantity": 100, "measure": "ml"}

Type: string | { price?: number; quantity?: number; measure?: string; }

base-sale-price

Price per unit for the sale price, in the same shape as base-price

Type: string | { price?: number; quantity?: number; measure?: string; }

brand

Product brand. Also set as data-brand on the card, so CSS can target cards by brand

Type: string

css-url

URL to external CSS file for custom styling

Type: string · Default: null

currency-sign

The currency sign is displayed after the price

Type: string · Default: undefined

custom-labels

Labels from the product feed, separated by |. Hidden by default — show them with the custom-label-N parts, which exist for the first five. Also set as data-custom-label-N

Type: string · Default: ""

Product page URL for the title and image links. Standalone, the card doesn't navigate — handle vviinnProductClick

Type: string

energy-certifications

Energy labels, set as a JS property

Type: { certificationClass?: "A+++" | "A++" | "A+" | "A" | "B" | "C" | "D" | "E" | "F" | "G"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: "A+++" | "A++" | "A+" | "A" | "B" | "C" | "D" | "E" | "F" | "G"; max?: "A+++" | "A++" | "A+" | "A" | "B" | "C" | "D" | "E" | "F" | "G"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]

entity-type

What the card shows: a product, a content entry or a list entry

Type: "content" | "list" | "product" · Default: "product"

favorite-show

Show or hide Favorite button

Type: boolean

image

URL of the main product image

Type: string

image-width

Image width in pixels. Ignored when responsive is set

Type: number · Default: PRODUCT_CARD_IMAGE_WIDTH

images

Product images, set as a JS property. Used by show-multiple-images when there are at least two

Type: { original: string; thumbnail: string; }[] · Default: []

is-set-mode

Render the card for Set mode: Update button, discount label, and Add to Basket regardless of add-to-basket-show

Type: boolean · Default: false

locale

Locale for text localization

Type: "de-DE" | "en-US"

number-locale

Locale for number formatting. Falls back to locale

Type: string

price

Regular price

Type: number

price-prefix

Prefix is displayed before the price

Type: string

product-title

Product title

Type: string

product-type

Product type

Type: string

responsive

Let the image fill the card width instead of image-width

Type: boolean · Default: false

sale-price

Sale price. When set, the regular price is shown as outdated next to it

Type: number

show-multiple-images

Show multiple images: swiper on mobile, hover on desktop

Type: boolean · Default: false

update-button-location

Location of Update button for Set mode

Type: "onItem" | "onTop" | "topAndItem"

Listen with document.addEventListener(). The pages under Events describe the data each event carries.

EventDescription
vviinnAddToBasketUser clicks on Add to Basket button
vviinnAddToFavoriteUser clicks on Favorite button
vviinnProductClickEmitted on a click on a link in the card, instead of following the link
vviinnProductLoadEmitted once when the card has rendered
vviinnProductViewEmitted when at least 95% of the card's image is visible

Replace texts and icons with your own content: Replace Widget Content.

SlotDescription
vviinn-basket-button-iconIcon of Add to Basket button.
vviinn-basket-button-icon-pressedIcon of pressed Add to Basket button (Set mode).
vviinn-basket-button-textText of Add to Basket button.
vviinn-basket-button-text-pressedText of pressed Add to Basket button (Set mode).
vviinn-custom-label-0Custom label with index 0.
vviinn-custom-label-1Custom label with index 1.
vviinn-custom-label-2Custom label with index 2.
vviinn-custom-label-3Custom label with index 3.
vviinn-custom-label-4Custom label with index 4.
vviinn-energy-label-data-sheet-textData sheet link's text.
vviinn-favorite-iconIcon of Favorite button.
vviinn-favorite-icon-pressedIcon of pressed Favorite button.
vviinn-image-placeholder-iconIcon or content for the image placeholder.
vviinn-product-card-actionsAdd action buttons like One-Click Discovery to this slot.
vviinn-update-button-iconIcon of Update Button (Set mode).

Style these elements with vviinn-product-card::part(name): Styling Specific Elements.

PartDescription
basket-buttonAdd to Basket button.
basket-button-containerProduct Card's basket button container.
brandProduct brand.
content-cardContent card container. Styled through an embedding widget, e.g. vviinn-results::part(content-card).
content-card-content-containerContent card's content container.
content-card-imageContent card's image.
content-card-image-containerContent card's image container.
content-card-image-picturePicture element for content card's image.
content-containerProduct Card's content container. On content cards, not exported to the widgets.
content-labelContent card's label.
content-linkContent card's link.
content-titleContent card's title.
currencyCurrency sign. Renders after price-amount.
custom-label-0Custom label with index 0.
custom-label-1Custom label with index 1.
custom-label-2Custom label with index 2.
custom-label-3Custom label with index 3.
custom-label-4Custom label with index 4.
custom-label-contentCustom labels in the content area. Combine with custom-label-N to pick one place.
custom-label-imageCustom labels on the image. Combine with custom-label-N to pick one place.
deeplinkAnchor element for title. Rendered only if "deeplink" property is filled.
discount-labelDiscount label in Product Card (Set mode).
discount-percentageDiscount percentage inside the Add to Basket button (Set mode).
energy-label-containerEnergy label container.
energy-label-data-sheet-linkData sheet link.
energy-label-iconIcon with an energy class.
energy-label-product-typeProduct type.
favorite-buttonFavorite button.
imageProduct image.
image-containerProduct Card's image container.
image-linkAnchor element for image. Rendered only if "deeplink" property filled.
image-picturePicture element for image.
image-placeholderPlaceholder shown when no image is available.
image-skeletonPlaceholder shown while the image loads.
list-cardList card container. Styled through an embedding widget, e.g. vviinn-results::part(list-card).
list-card-content-containerList card's content container.
list-card-imageList card's image.
list-card-image-containerList card's image container.
list-card-image-picturePicture element for list card's image.
list-containerSame element as list-card-content-container. Not exported to the widgets.
list-labelList card's label (e.g., "Category").
list-titleList card's title.
price-amount-base-outdatedNumeric part of the regular price per unit shown as outdated.
price-amount-base-regularNumeric part of the regular price per unit.
price-amount-base-saleNumeric part of the sale price per unit.
price-amount-outdatedNumeric part of the regular price shown as outdated.
price-amount-regularNumeric part of the regular price.
price-amount-saleNumeric part of the sale price.
price-containerWrapper around the price values. Rendered only if "add-price-container" property is set.
price-outdatedRenders when "sale-price" property filled. Contains regular price.
price-prefixRenders before price-amount. Can be set with "price-prefix" property or inherited from parent component.
price-regularRenders when "sale-price" property is empty.
price-saleRenders when "sale-price" property filled. Contains sale price.
product-cardCard container. Styled through an embedding widget, e.g. vviinn-results::part(product-card).
product-card-actionsStyle actions wrapper.
product-card-actions-topStyle top actions wrapper.
product-images-paginationContainer for product images pagination dots (mobile only).
product-images-pagination-bulletIndividual pagination dot.
product-images-pagination-bullet-activeActive pagination dot.
product-typeProduct type.
titleProduct title
update-button-itemUpdate button in Product Card (Set mode).

Set them on vviinn-product-card or a parent element: CSS Variables.

PropertyDescription
--basket-button-bg-color-pressedThe background color of the pressed Basket Button.
--font-familyThe font family of the product card.
--product-card-content-alignThe alignment of the content inside the product card's flex container.
--product-card-image-aspect-ratioThe aspect ratio of the product card image (e.g., "1 / 1", "3 / 4").
--product-card-image-bg-colorThe background color of the product card image.
--product-card-image-borderThe border of the product card image.
--product-card-text-alignThe alignment of the text inside the product card.
--product-card-transition-durationDuration of skeleton to content transitions.