Tally UI

ProductCard

A compact card showing product image, title, and price

Import

import { ProductCard } from '@tallyui/components';

Usage

<ProductCard doc={productDocument} onPress={() => addToCart(doc)} />

Combines ProductImage, ProductTitle, and ProductPrice into a single tappable card. When onPress is provided, the entire card becomes pressable.

Props

PropTypeDefaultDescription
docanyrequiredRxDB product document
onPress() => voidTap handler (wraps card in Pressable)
imageSizenumber80Image width/height in pixels
currencySymbolstring'$'Currency symbol for price
classNamestringOverride card container styles

Default classes: items-center gap-2 rounded-lg bg-surface p-3

Composition

ProductCard renders these components internally:

  • ProductImage with size={imageSize} and rounded corners
  • ProductTitle truncated to 2 lines
  • ProductPrice with the provided currency symbol

Live demo

On this page