Skip to content

Product Card

High-performance product display component designed for modern e-commerce. Beyond basic layouts, it features a deep-seated marketing badge system, multi-price strategies (VIP/Member), hover multimedia previews, stock feedback, and built-in exposure tracking.

Layout Paradigms

Common layouts for grid, list, and recommendation scenarios.

Editor Choice
YH-UI Intelligent Suite

YH-UI Intelligent Suite

Fast, efficient, and scalable Vue 3 component library for your projects.
¥999.00
¥1299.00
Grid Layout (Vertical)

List Layout

Horizontal arrangement, suitable for search results or mobile feeds.

Industrial Gantt Component
Hot

Industrial Gantt Component

Drag-and-drop, zoomable, highly customizable Gantt chart.
¥1699.00
¥2500.00
List Layout (Horizontal)

Compact Layout

Minimalist display, suitable for sidebars or recommendation snippets.

Compact Display

Compact Display

Compact mode now preserves simple action buttons.
¥69.00
Compact Layout

Stock Progress

Built-in marketing progress bar to increase conversion rates through visual urgency.

Limited Sale Product

Limited Sale Product

¥299.00
¥399.00
Sold 60%
Stock Progress Feedback

Advanced Business Features

Deeply encapsulated features for modern e-commerce business logic.

Marketing Badges & Ribbons

Supports slanted ribbons in the corner and a combination of image/text badges for highlighting promotions.

Editor's Choice
Marketing Badge Showcase
badgeSave $40Fast Delivery

Marketing Badge Showcase

Supports slanted ribbons and combined image/text badge groups.
¥1299.00
Marketing Atmosphere

Pricing Logic feedback

Features a comprehensive pricing system including market prices, VIP/final prices, and unit suffixes.

Pricing Strategy Demo

Pricing Strategy Demo

¥699.00/yr
VIP Price¥599.00
¥999.00
85% Sold, Almost Gone
Pricing & ROI

Hover Multimedia Preview

Boost click-through rates by enabling auto-switch to hover-image or silent looping video overlays.

Hover Multimedia Demo

Hover Multimedia Demo

Hover image to trigger video preview or image switch.
¥299.00
Multimedia Engagement

Conversion Readiness

Handles action button Loading (debounce) and Sold Out (auto-grayscale/mask).

Loading State

Loading State

¥88.00
Sold Out Mask
Sold Out

Sold Out Mask

¥0.00
Conversion Status

Analytics Tracking

Built-in IntersectionObserver. When enabled (exposure), the component emits an expose event when it stays in the viewport beyond a threshold.

vue
<yh-product-card exposure :exposure-threshold="0.5" @expose="onExpose" />

Use in Nuxt

YhProductCard supports Nuxt 3/4 SSR rendering. When @yh-ui/nuxt is installed, the component can be auto-imported. For hover video previews, exposure analytics, or other client-only behavior, prefer <ClientOnly> or verify those interactions in client-side lifecycle hooks.

API

Props (100% aligned with source)

PropertyDescriptionTypeDefault
imagePrimary image URLstring''
hover-imageAlt image on mouse hoverstring''
video-srcVideo preview URL on hoverstring''
titleProduct titlestring''
title-linesTitle line clamping limitnumber2
descriptionProduct descriptionstring''
description-linesDescription line clamping limitnumber1
priceCurrent selling pricenumber | string0
market-priceReference/Market pricenumber | string''
vip-priceExclusive member pricenumber | string''
vip-labelMember price tag textstring''
currencyCurrency symbolstring'¥'
unitPrice measurement suffixstring''
ribbonMarketing ribbon textstring''
ribbon-colorRibbon background colorstring''
tagLegacy: Single tag textstring''
tag-typeLegacy: Tag color type'primary' | 'success' | 'warning' | 'danger' | 'info''danger'
badgesMulti-badge array (text/image)ProductBadge[][]
layoutLayout mode'vertical' | 'horizontal' | 'compact' | 'grid''vertical'
lazyImage lazy loadingbooleantrue
borderEnable card borderbooleantrue
shadowEnable hover elevation shadowbooleantrue
readonlyHide all action buttonsbooleanfalse
stock-progressFlash sale stock progress (0-100)number0
stock-colorProgress bar color/gradientstring''
stock-textStock progress labelstring''
action-textPrimary button textstring''
action-loadingPrimary button loading statebooleanfalse
sold-outMark as sold out (mask + grayscale)booleanfalse
exposureEnable automatic exposure analyticsbooleanfalse
exposure-thresholdRatio threshold for analyticsnumber0.5
exposure-onceReport only once per sessionbooleantrue

Events

NameDescriptionParameters
clickFired when clicking the card(e: MouseEvent)
actionFired when clicking primary button(e: MouseEvent)
exposeFired on exposure threshold hit() => void

Slots

NameDescription
titleCustom title template
descriptionCustom description template
footerCustom bottom action area

Expose

This component does not expose public instance methods or properties.

Theme Variables

This component supports theme-overrides for visual customization such as borders, prices, badges, and action areas. When a dedicated CSS variable table is not listed separately, prefer theme-overrides together with global theme tokens as the source of truth.

ProductBadge Interface

ts
interface ProductBadge {
  text?: string
  image?: string
  type?: 'primary' | 'success' | 'warning' | 'danger' | 'info'
  color?: string
}

Type Exports

NameDescription
YhProductCardPropsComponent props type
YhProductCardEmitsComponent emits type
YhProductCardSlotsComponent slots type
YhProductCardLayoutLayout mode union
YhProductBadgeProduct badge type
YhProductCardInstanceComponent instance type

Released under the MIT License.