Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Price for Astro

Astro parts for amounts, currency labels, and billing periods.

$99.00/ month

Installation

bunx --bun shadcn@latest add @gnostic/price

Usage

import { Price, PriceUnit, PriceValue } from "@/components/ui/price"
<Price>
  <PriceValue price={99} />
  <PriceUnit>month</PriceUnit>
</Price>

Examples

€29.00/ month
$79.00$99.00Save 20%/ month
$50.00 - $100.00/ month
$249.00$299.00Save $50.00

Notes

  • Use compareAt to show the original price and automatic savings output.
  • Pass currency and locale when the default USD and en-US formatting are not correct for your project.
  • Use showDiscount={false} when you want the strike-through price without the savings badge.

API Reference

Read the installed source for the complete prop types.

When to use Price

Use Price to arrange the amount and its context in a pricing card or product summary. Keep currency, billing interval, and any conditions close to the number. Supply already formatted content through the parts.

Keyboard and behavior

Price displays text; it does not convert currencies, calculate tax, or process payment. Make a discounted price understandable in the reading order and explain whether an amount recurs.

Theme and layout

Typography can emphasize the amount while keeping its unit readable. Test long localized amounts and currency symbols. Use theme text tokens so the smaller billing text remains legible.