Price
Shows a price in the shopper's locale, with the original price and the percentage saved when it is reduced, and a hint such as tax and shipping.
Parts
| Part | File | Does |
|---|---|---|
| Price | Price.vue | Shows a price, with the original price and discount percentage when reduced. |
| PriceAmount | PriceAmount.vue | Shows the current price of the product. |
| PriceRef | PriceRef.vue | Shows the original price of a discounted product. |
| PriceDiscount | PriceDiscount.vue | Shows the percentage saved against the original price. |
| PriceHint | PriceHint.vue | Holds a note below the price, such as tax and shipping, which may link on. |
Anatomy
<Price>
<PriceDiscount />
<PriceRef />
<PriceAmount />
<PriceHint />
</Price>Styling
All of Price’s styles live in price.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- class-variance-authority
- reka-ui
Built from
API reference
Shows a price, with the original price and discount percentage when reduced. Renders a <span>.
Props 10
| Prop | Type | Default | |
|---|---|---|---|
| class | ClassValue | — | |
| |||
| size | PriceSize | 'md' | |
| |||
| align | PriceAlign | 'start' | |
| |||
| price* | PriceType | — | |
| |||
| locale | string | — | |
| |||
| showRef | boolean | true | |
| |||
| showDiscount | boolean | true | |
| |||
| showHint | boolean | true | |
| |||
| refLabel | string | 'Was' | |
| |||
| amountLabel | string | 'Now' | |
| |||
Slots 1
| Slot | Slot props | |
|---|---|---|
| hint | — | |
| ||