Skip to content

Price Tag

DisplayMIT
View in Storybook

Formatted currency price with optional compare-at strikethrough and discount pill.

bun add @otfdashkit/ui

Preview

Price Tag
Loading Storybook preview…

Code

import { PriceTag } from '@otfdashkit/ui'

export function Example() {
  return (
    <PriceTag amount={1800} currency="USD" />
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Kit for this component

Marketplace Kit$99

Show a product price on a listing or product card.

See the kit

Props

Props declared in the PriceTag source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
amountrequirednumberPrice in minor units (e.g. cents).
compareAtnumberOriginal/compare-at price in minor units — renders struck-through when greater than `amount`.
currencystring'USD'ISO 4217 currency code. Default 'USD'.
localestring'en-US'BCP-47 locale for formatting. Default 'en-US'.
showDiscountbooleantrueShow the "−N%" discount pill when on sale. Default true.
size'sm' | 'lg' | 'md''md'Size scale. Default 'md'.