Tally UI

ProductPrice

Displays product price with sale price support

Import

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

Usage

<ProductPrice doc={productDocument} currencySymbol="$" />

Handles sale prices automatically — regular prices use text-price, sale prices use text-sale with a "was" indicator.

Props

PropTypeDefaultDescription
docanyrequiredRxDB product document
currencySymbolstring'$'Currency symbol to prepend
classNamestringOverride default styles

Default classes: text-sm font-medium text-price (or text-sale when on sale)

Trait mapping

ConnectorPrice sourceSale detection
WooCommercedoc.price (string)doc.on_sale boolean
Medusadoc.variants[0].prices[0].amount (cents)Price lists (not on product)
Shopifydoc.variants[0].price (string)compare_at_price > price
Venduredoc.variants[0].priceWithTax (cents)Promotions (not on product)

Live demo

On this page