ApplyPromoCode
A compact input with an apply button that lets customers enter and validate promotional discount codes during checkout.Preview
View in StorybookImport
Usage
Props
Async callback to validate and apply the promo code. Should return the discount result or throw on invalid codes.
Currently applied promo code, if any.
Callback to remove the currently applied promo code.
Behavior
- Inline validation with loading state during API call
- Shows success message with discount amount on valid code
- Shows error message for invalid or expired codes
- Displays applied code as a removable chip
- Collapses to “Have a promo code?” link when no code is applied