Price Tag
DisplayMITFormatted currency price with optional compare-at strikethrough and discount pill.
bun add @otfdashkit/ui
Preview
Price TagDisplay
Loading Storybook preview…
Code
@otfdashkit/uiimport { 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.
Props
Props declared in the PriceTag source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| amountrequired | number | Price in minor units (e.g. cents). | |
| compareAt | number | Original/compare-at price in minor units — renders struck-through when greater than `amount`. | |
| currency | string | 'USD' | ISO 4217 currency code. Default 'USD'. |
| locale | string | 'en-US' | BCP-47 locale for formatting. Default 'en-US'. |
| showDiscount | boolean | true | Show the "−N%" discount pill when on sale. Default true. |
| size | 'sm' | 'lg' | 'md' | 'md' | Size scale. Default 'md'. |