Skip to main content

Price

Prices are used to display the price of a given product, discount and total values.

Importโ€‹

import { Price } from '@faststore/ui'

Usageโ€‹

62.5

Variantsโ€‹

Installmentโ€‹

62.5

Listingโ€‹

62.5

Savingsโ€‹

62.5

Sellingโ€‹

62.5

Spotโ€‹

62.5

Examplesโ€‹

INTL Formatted to partsโ€‹

$62.50

INTL Formattedโ€‹

โ‚ฌ62.50

Customโ€‹

62,5 reais

Propsโ€‹

asElementType<any>
Description

Set the HTML element tag of this component.

testIdstring
Description

ID to find this component in testing tools (e.g.: cypress, testing library, and jest).

Default value
store-price
value*number
Description

The raw price value.

formatterPriceFormatter
Description

Formatter function that transforms the raw price value and render the result.

Default value
(price) => price
variantPriceVariant
Description

The current use case variant for prices.

Default value
selling

Customizationโ€‹

data-store-price

data-variant

Formatter function exampleโ€‹

function customFormatter(price: number) {
const unformattedPrice = `${price}`
const formattedPrice = `${unformattedPrice.replace('.', ',')} reais`

return formattedPrice
},

Didn't find your answers? Ask the Community. For documentation suggestions, submit your feedback.

JOIN THE COMMUNITY