Skip to content
Latestv1.0.63

Coupon Card ​

Standard component for displaying coupon information. It supports cutout variants, status display, optional selection mode, and e-commerce style badge, progress, and rules sections.

Basic Usage ​

Displays core coupon info. Supports circle (default), indent, and scallop variants.

Basic Usage

Status Management ​

Supports available, used, expired, and locked states.

States

Selection Mode ​

Enable selectable mode for checkout pages using v-model:selected.

Selectable Mode

Advanced Features ​

Enhanced features for modern e-commerce scenarios: badges, progress bars, and rules drawer.

Advanced Features

Usage in Nuxt ​

YhCouponCard works directly in Nuxt 3/4 projects. When yh-ui/nuxt is enabled, the component can be used without manual registration.

Nuxt Integration
## API

Props ​

PropertyDescriptionTypeDefault
titleCoupon titlestring''
descriptionDescription textstring''
amountAmount valuestring | number''
symbolCurrency symbolstring'¥'
thresholdMinimum spendstring | number''
valid-periodValidity periodstring''
statusState'available' | 'used' | 'expired' | 'locked''available'
variantCutout variant'circle' | 'indent' | 'scallop''circle'
selectableEnable selectable modebooleanfalse
selectedSelected state (v-model)booleanfalse
action-textAction button textstring''
badgeBadge textstring''
badge-typeBadge color type'danger' | 'warning' | 'primary' | 'success''danger'
percentProgress percentage (0-100)numberundefined
percent-textTip text near progress barstring''
rulesUsage rules text at bottomstring''
rule-titleCustom title for rules sectionstring''
disabledWhether disabled styling is appliedbooleanfalse
theme-overridesTheme variable overridesRecord<string, string>{}

Events ​

Event NameDescriptionParameters
clickFired when card is clicked(e: MouseEvent) => void
actionFired when button is clicked(e: MouseEvent) => void
update:selectedSelected state change event(val: boolean) => void

Slots ​

SlotDescriptionParameters
titleCustom coupon title-
descriptionCustom description area-
actionCustom action area-
badgeCustom badge content-
sealCustom status seal{ status: CouponStatus }
rulesCustom rules section-

Expose ​

This component does not expose public instance methods or properties.

Theme Variables ​

VariableDescriptionDefault
--yh-coupon-bgCard background colorvar(--yh-bg-color-overlay)
--yh-coupon-primary-colorAccent color (amount/button)var(--yh-color-primary)
--yh-coupon-amount-sizeAmount font size28px

Type Exports ​

NameDescription
YhCouponCardPropsComponent props type
YhCouponCardEmitsComponent emits type
YhCouponCardSlotsComponent slots type
YhCouponStatusCoupon status union type
YhCouponCardInstanceComponent instance type

Released under the MIT License.