promo-code

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

PartFileDoes
PromoCodePromoCode.vueLets the shopper apply promo codes and shows the discounts they take off the order.
PromoCodeFieldPromoCodeField.vueThe 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

PromoCode.vue

Lets the shopper apply promo codes and shows the discounts they take off the order.

Props 17

PropTypeDefault
subtotal*PriceType—
appliedAppliedDiscount[][]
noticePromoNotice—
titlestring'Promo code'
descriptionstring—
codeLabelstring'Code'
placeholderstring'Enter a code'
applyLabelstring'Apply'
hintstring—
removeLabel((label: string) => string)`Remove ${label}`
subtotalLabelstring'Subtotal'
totalLabelstring'To pay'
minusSignstringMINUS_SIGN
localestring—
surface'raised' | 'bare''raised'
classClassValue—
modelValuestring''

Events 3

EventPayload
update:modelValuevalue: string
removecode: AppliedDiscount
applycode: string

Data attributes 1

Data attributeValues
data-surface'raised' | 'bare'

Recipe hint 1 group

Recipe heading 1 group

PromoCodeField.vue
Promo Code