Skip to content

Currency - Web Component โ€‹

The Currency component can be used imported from:

Playground โ€‹

Parameters โ€‹

The Web component uses the <z-currency> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
amountnumberThe value to be displayed in the currency format.
localestringThe locale to be used. If not set, the default locale of the browser will be used.
currencystringThe currency to be used for formatting the value.
decimalsnumberThe number of decimals to be displayed.

Slots โ€‹

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription

Parameters use โ€‹

amount โ€‹

The amount to be displayed as a currency.

locale โ€‹

The locale to be used to format the currency. If not set, the default locale of the browser will be used.

currency โ€‹

The currency to be used to format the currency. If not set, the default currency of the locale will be used.

decimals โ€‹

The number of decimals to be displayed. If not set, the default number of decimals of the currency will be used.

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹