ValyroUI English version

Product Card

Карточка товара. Pro · Магазин и платежи › Каталог

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add product-card
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { ProductCard } from 'valyro-ui-pro';

Пропсы

PropTypeDefault
layout'vertical' | 'horizontal''vertical'vertical: image on top with a full-width add button; horizontal: a compact row with a small thumbnail.
swatchstringSelected swatch value.
defaultSwatchstringInitial swatch when uncontrolled.
onSwatchChange(value: string) => voidCalled with the new swatch when it changes.
wishlistedbooleanControlled wishlisted; use with onWishlistedChange.
defaultWishlistedbooleanfalseInitial wishlisted when uncontrolled.
onWishlistedChange(wishlisted: boolean) => voidCalled with the new wishlisted when it changes.
onAddToCart() => void | Promise<void>May return a promise: the button shows a spinner until it settles, then "Added".
localestringLocale for prices and counts (default: the ThemeProvider's, then the browser's).
labelsPartial<ProductCardLabels>Overrides for the built-in English text; keys left out keep their defaults.
title *string
price *number
compareAtPricenumberOriginal price; shows a strikethrough and a "Sale −N%" badge.
currencystring'USD'
isNewboolean
soldOutbooleanOut of stock: the add-to-cart button is disabled and a badge says so.
ratingnumber0–5.
reviewCountnumber
swatchesProductSwatch[][]
imageSrcstringProduct photo URL; falls back to a generated placeholder.
hoverImageSrcstringSecond photo revealed on hover.
imageSeedstringSeed for the generated product image (defaults to the title).
hoverImageSeedstringSeed for a generated second image revealed on hover; without any hover image the photo zooms instead.
imageIconReactNode<ShoppingBagIcon />

Похожие компоненты

  • Product Grid — Каталог товаров
  • Product Filters — Фильтры каталога
  • Product Spotlight — Рекомендованный товар: фото с пометкой, цена, рейтинг и действия
  • Reviews Summary — Отзывы: средняя оценка, гистограмма-фильтр, сортировка и полезность
  • Guided Product Finder — Мастер подбора товара: вопросы с ветвлением и объяснение, почему подошло
  • Location Card — Точка продаж: расстояние, часы работы, способы получения и заказ
  • Shopping Cart Drawer — Выдвижная корзина
  • Checkout Summary — Сводка оформления заказа
  • Checkout Form — Оформление заказа: доставка, тип адреса, оплата и проверка полей
  • Order Tracking — Отслеживание заказа: этапы, перевозчик, трек-номер и история
  • Invoice — Счёт для печати: позиции, налоги, скидки и итоги в валюте
  • Credit Card — Банковская карта: градиент или две тональности, сеть по номеру, бесконтактная оплата

Назад: Template Card · Далее: Product Grid · Весь раздел «Магазин и платежи»