Return to Sky UI homepage
import { Price } from '@sky-uk/ui-core';

The Price component is used to show key pricing information in a preset inline format.

For brochureware and product discovery pricing see HeadlinePrice.

Content

PropDescription
disclaimer

Disclaimer content can be used for further clarification on a price, for example if the price is a limited time offer or increases after a certain amount of time.

prefixNormally used for ‘from’ but can be changed if required, or turned off entirely.
priceMain text area for the amount including decimals.
strikethroughPrice

A discount option is available which allows the designer to enter in an old price which is struck-out.

suffixNormally used for a term period, the suffix can be edited, or turned off entirely.

disclaimer

Price

The price expects a string including the unit and amount, any zero decimal amounts (.00) will be omitted.

strikethroughPrice

Props

PropTypeOptions (* default)
$alignstringleft* | center | right
$appearancestringdefault* | light
$inlinePrefixbooleantrue | false*
$inlineSuffixbooleantrue | false*
$sizestringsmall | medium*

$align

$appearance

$inlinePrefix | $inlineSuffix

$inlinePrefix sets the prefix or strikethroughPrice to show inline with price. $inlineSuffix sets the suffix text to show inline with the price. Both can be set independently to achieve the required layout.

$size

System Modifiers

This component also supports the props applied using the following system modifiers:

Translatable Fields

This component supports translation on the following fields:

  • headlinePrice.previousPriceText - sets the hidden text used on the previous price when strikethroughPrice is provided
  • headlinePrice.currentPriceText - sets the hidden text used on the current price when strikethroughPrice is provided

For more on translatable fields, view the useTranslation docs here: useTranslation