Skip to content
OTF Kit logoOTF Kit

Price Tag

Display

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

View in Storybook
Price Tag
Loading Storybook preview…

Installation

bun add @otfdashkit/ui

Usage

Import PriceTag from @otfdashkit/ui.

Code
// Price Tag — Formatted currency price with optional compare-at strikethrough and discount pill.
//
// Install:
//   bun add @otfdashkit/ui

import { PriceTag } from '@otfdashkit/ui'

export function Example() {
  return (
    <PriceTag>
      {/* your content */}
    </PriceTag>
  )
}

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'.

Related