Price

Right-aligned monetary amount with optional currency suffix from @duo/ui.

Examples

Properties

PropertyAttributeDescriptionType nameTypeDefault
amountamountNumeric amount when the default slot is empty.stringstring""
currencycurrencyCurrency symbol or code when the currency slot is empty.stringstring""
emphasisemphasisLarger, higher-contrast amount typography.booleanbooleanfalse

Slots

NameDescription
defaultAmount value; overrides `amount` when provided.
currencyCurrency symbol or code; overrides `currency` when provided.

Usage

Price formats a monetary amount with an optional currency suffix on the right, right-aligned typography, and a compact default style or a larger emphasis style for hero and comparison layouts.

Do

  • Use amount and currency for simple templated values; use slots when markup or localization needs more control.
  • Enable emphasis for primary plan prices, totals, or other amounts that should stand out in the layout.
  • Keep currency symbols or codes short and meaningful for the product locale.
  • Align Price to the end of rows or columns where monetary values are compared.

Don’t

  • Don’t use Price for editable monetary input — use a number or currency field instead.
  • Don’t use it for non-monetary numbers such as counts or percentages.
  • Don’t rely on emphasis styling alone to communicate promotional or discounted state — pair with supporting copy or badges.

Variants

NamePurpose
defaultCompact lead-weight amount with secondary text color.
emphasisLarger headline-scale amount with primary text color (emphasis attribute).

Slots

NamePurpose
defaultAmount value; overrides amount when provided.
currencyCurrency symbol or code; overrides currency when provided.