Skip to content
Calm motion: animations on this site only fade, with no movement

Product card ​

A product with an image, the name, the price, the rating, and an add button

Shows one product in a grid of a shop. Put many cards in a CSS grid to make a catalog. For a product page, use the variant picker and the price.

Basic
Sale

USB microphone, cardioid

Rated 4,6 out of 5, 128 reviews

Now Rp 899.000, was Rp 1.299.000, 31% off
New

Closed-back headphones

Rated 4,3 out of 5, 54 reviews

Rp 650.000
  • name is the name of the product. With href, the name is a link to the product page.
  • image is the picture, and imageAlt describes it. If the name says enough, leave imageAlt empty.
  • price and was go to the price, with currency and locale.
  • rating (out of 5) and reviews show as "★ 4.6 (128)". Screen readers hear "Rated 4.6 out of 5, 128 reviews".
  • badge is a short tag on the image, such as "New".
  • The button emits add. Its name ends with the name of the product, so a list of cards does not have many buttons with the same name.
  • With soldOut, the image turns gray, the tag says "Sold out", and the button is off.
  • Change the words with labels or a label pack: add, soldOut, and rated (a function).

Usage ​

ts
import { BlessProductCard } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
name*string—
hrefstring—the page of the product
imagestring—
imageAltstring""describe the image; leave empty when the name says enough
price*number—
wasnumber—
currencystring"USD"
localestring"en"
ratingnumber—the average rating, out of 5
reviewsnumber—
badgestring—a short tag on the image, such as "New"
soldOutboolean—
labelsPartial<{ add: string; soldOut: string; rated: (value: string, count: number) => string; }>—

Events

NamePayloadDescription
add[]

Released under the MIT License. Character names and artwork belong to their owners.