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
nameis the name of the product. Withhref, the name is a link to the product page.imageis the picture, andimageAltdescribes it. If the name says enough, leaveimageAltempty.priceandwasgo to the price, withcurrencyandlocale.rating(out of 5) andreviewsshow as "★ 4.6 (128)". Screen readers hear "Rated 4.6 out of 5, 128 reviews".badgeis 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
labelsor a label pack:add,soldOut, andrated(a function).
Usage
ts
import { BlessProductCard } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
name* | string | — | |
href | string | — | the page of the product |
image | string | — | |
imageAlt | string | "" | describe the image; leave empty when the name says enough |
price* | number | — | |
was | number | — | |
currency | string | "USD" | |
locale | string | "en" | |
rating | number | — | the average rating, out of 5 |
reviews | number | — | |
badge | string | — | a short tag on the image, such as "New" |
soldOut | boolean | — | |
labels | Partial<{ add: string; soldOut: string; rated: (value: string, count: number) => string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
add | [] |