Sample notebook
$30$24Example product details. The picture follows your pointer; the arrow keys step through the set.
A product with a gallery worth using: the picture follows your pointer and zooms, slides the way you move through the set, and the add button confirms when the add has happened. Cards.
Open playgroundExample product details. The picture follows your pointer; the arrow keys step through the set.
ProductCard is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ProductCard } from "@ashutoshswamy/smoui" and set badge, rating, onWishlist among its 9 props.
npm i @ashutoshswamy/smouiimport { ProductCard } from "@ashutoshswamy/smoui";
<ProductCard name="Notebook" price="$24" images={[{ src: "/front.jpg", alt: "Notebook front" }, { src: "/back.jpg", alt: "Notebook back" }]} onAction={() => addToCart()} />A tag over the picture and a struck-through earlier price.
stringA star row under the name.
numberAdds a heart button.
(on: boolean) => voidA promise shows a busy state, then confirms.
() => void | PromiseMakes each row a button that filters to that level.
(stars: number | null) => voidProduct title and formatted price.
stringGallery images with descriptive alt text.
{ src: string; alt: string }[]Optional supporting detail.
stringOptional action button and its label.
() => void / string