Back to components

Primitives

Price Display

Renders a Money value with locale-aware formatting, an optional struck-through compare-at price, and an automatic discount badge.

money
currency
discount

Preview

$129.00$179.00-28%

Installation

Run the shadcn CLI. Dependencies and the shared lib block come with it.

npx shadcn add price-display

Usage

Import
import { PriceDisplay } from "@/components/lumo/price-display"
Example
<PriceDisplay
  price={{ amount: 12900, currency: "USD" }}
  compareAtPrice={{ amount: 17900, currency: "USD" }}
  size="lg"
/>

Props

PropTypeDefaultRequired
priceMoney-
Required
compareAtPriceMoney-
showDiscountbooleantrue
size"sm" | "md" | "lg""md"
localestring-

All props accept standard HTML attributes unless otherwise specified.

Dependencies

Lumo blocks

  • lib

npm packages

class-variance-authority

Own every line

Lumo blocks copy into your repo. No runtime dependency, no lock-in. Edit the code to fit your product.