ProductCard
ProductCard combines ProductImage, ProductTitle, and ProductPrice in a compact card with optional press handling, image size, and currency symbol.
Import
import { ProductCard } from '@tallyui/components';Usage
<ProductCard doc={productDocument} onPress={() => addToCart(productDocument)} />Combines ProductImage, ProductTitle, and ProductPrice into a single tappable card. When onPress is provided, the entire card becomes pressable.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
doc | any | required | RxDB product document |
onPress | () => void | — | Tap handler (wraps card in Pressable) |
imageSize | number | 80 | Image width/height in pixels |
currencySymbol | string | — | Currency symbol for price |
notSoldLabel | string | 'Not sold here' | Shown in place of the price when the channel doesn't sell this product. |
className | string | — | Override card container styles |
Default classes: items-center rounded-lg border border-border bg-card p-3
Composition
ProductCard renders these components internally:
ProductImagewithsize={imageSize}and rounded cornersProductTitletruncated to 2 linesProductPricewith the provided currency symbol