Promo Code
Voucher card with a code field and apply button, removable chips for applied promo codes and gift cards, a confirmation notice, and the order total after deductions.
Parts
| Part | File | Does |
|---|---|---|
| PromoCode | PromoCode.vue | Lets the shopper apply promo codes and shows the discounts they take off the order. |
| PromoCodeField | PromoCodeField.vue | The promo code field with its hint, the applied codes as removable chips and an optional notice; PromoCode's body, for placing inside another summary. |
Anatomy
<PromoCode>
<PromoCodeField />
</PromoCode>Styling
All of Promo Code’s styles live in promo-code.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @lucide/vue
Built from
API reference
Lets the shopper apply promo codes and shows the discounts they take off the order.
Props 17
| Prop | Type | Default | |
|---|---|---|---|
| subtotal* | PriceType | — | |
| |||
| applied | AppliedDiscount[] | [] | |
| |||
| notice | PromoNotice | — | |
| |||
| title | string | 'Promo code' | |
| |||
| description | string | — | |
| |||
| codeLabel | string | 'Code' | |
| |||
| placeholder | string | 'Enter a code' | |
| |||
| applyLabel | string | 'Apply' | |
| |||
| hint | string | — | |
| |||
| removeLabel | ((label: string) => string) | `Remove ${label}` | |
| |||
| subtotalLabel | string | 'Subtotal' | |
| |||
| totalLabel | string | 'To pay' | |
| |||
| minusSign | string | MINUS_SIGN | |
| |||
| locale | string | — | |
| |||
| surface | 'raised' | 'bare' | 'raised' | |
| |||
| class | ClassValue | — | |
| |||
| modelValue | string | '' | |
| |||
Events 3
| Event | Payload | |
|---|---|---|
| update:modelValue | value: string | |
| ||
| remove | code: AppliedDiscount | |
| ||
| apply | code: string | |
| ||
Data attributes 1
| Data attribute | Values | |
|---|---|---|
| data-surface | 'raised' | 'bare' | |
| ||