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.

States: Default

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

PartRecipe
PromoCodehint
PromoCodeheading

Install

Writes 4 files into components/sections/promo-code/. For agents, npx @frontic/ui docs promo-code prints this reference as markdown; the MCP server serves the same.

npm packages
@lucide/vue

Built from

API reference

PromoCode PromoCode.vue

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

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''
EventPayload
update:modelValuevalue: string
removecode: AppliedDiscount
applycode: string
Data attributeValues
data-surface'raised' | 'bare'
Recipe hintSets
base: hint 2 properties
Recipe headingSets
base: heading 1 property

PromoCodeField PromoCodeField.vue

Example