Velocity X Components

E-Commerce

Price Display

Formatted price with optional struck-through compare-at price and a percentage-off badge, in three sizes.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add price-display

Built for astro.

Full docs for Price Display →

Needs a licence key — subscribe here, then velocityx loginonce.

astro v1.0.0
Price Display
$189.00 $229.00 Save 17%
$189.00 $229.00 Save 17%
$189.00 $229.00 Save 17%
$129.00

Props

NameTypeRequiredDefaultDescription
pricenumberYes
compareAtPricenumberNo
currencystringNo'AUD'
localestringNo'en-AU'
size'sm' | 'md' | 'lg'No'md'
showBadgebooleanNotrue
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/price-display/PriceDisplay.astro

Using the Price Display component

Install it with velocityx add price-display. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from E-Commerce.