Promotion

CouponInput

Coupon code input with apply button and validation feedback.

CouponInput

An input field for coupon codes with an apply button. Shows success/error states after submission and displays the applied coupon with a remove option.

Preview

Try code: SAVE20

Usage

<CCouponInput @apply="handleApply" @remove="handleRemove" />

Pre-Applied Coupon

<CCouponInput
  :applied-coupon="{ code: 'SAVE20', discountLabel: '20% off' }"
  @remove="handleRemove"
/>

With Loading State

<CCouponInput :loading="isApplying" @apply="handleApply" />

With Error

<CCouponInput :error="'Invalid coupon code'" @apply="handleApply" />

Props

PropTypeDefaultDescription
appliedCoupon{ code: string; discountLabel?: string } | nullnullCurrently applied coupon
loadingbooleanfalseShow loading spinner
errorstring | nullnullError message
placeholderstring'Coupon code'Input placeholder
uiPartial<{...}>Per-instance theme overrides

Events

EventPayloadDescription
applystringCoupon code submitted
removeApplied coupon removed

Slots

SlotScoped PropsDescription
applied{ coupon, remove }Custom applied coupon display
input{ code, apply }Custom input + button