UnitPrice
The UnitPrice
component renders a string with a UnitPrice as the
Storefront API's MoneyV2 object with a reference unit from the Storefront API's UnitPriceMeasurement object.
Example code
Anchor link to section titled "Example code"
Name | Type | Description |
---|---|---|
data | PartialDeep<MoneyV2> |
An object with fields that correspond to the Storefront API's MoneyV2 object. |
measurement | PartialDeep<UnitPriceMeasurement> |
A UnitPriceMeasurement object. |
as? | TTag |
An HTML tag to be rendered as the base element wrapper. The default is div . |
Component type
Anchor link to section titled "Component type"The UnitPrice
component is a client component, which means that it renders on the client. For more information about component types, refer to React Server Components.
Storefront API data
Anchor link to section titled "Storefront API data"The data
prop is an object with fields that correspond to the Storefront API's MoneyV2 object: