Skip to content
Coupon field, light
Light
Coupon field, dark
Dark

Every state

  • Coupon field, default, light
    Coupon field, default, dark

    default

  • Coupon field, focus, light
    Coupon field, focus, dark

    focus

  • Coupon field, open, light
    Coupon field, open, dark

    open

  • Coupon field, filled, light
    Coupon field, filled, dark

    filled

  • Coupon field, checking, light
    Coupon field, checking, dark

    checking

  • Coupon field, invalid, light
    Coupon field, invalid, dark

    invalid

  • Coupon field, applied, light
    Coupon field, applied, dark

    applied

  • Coupon field, applied-gbp, light
    Coupon field, applied-gbp, dark

    applied-gbp

Props

PropTypeDefaultWhat it does
idstring"discount-code"Id of the input; the error id hangs off it.
labelstring"Discount code"Field label.
toggleLabelstring"Add a discount code"The disclosure's text while closed.
defaultOpenbooleanfalseStart with the field open.
defaultCodestring""Start with a code in the field.
applied{ code: string; saving: number; description?: string } | nullnullA code already on the order; saving in minor units.
onApply(code: string) => Promise<{ ok: true; code; saving; description? } | { ok: false; message }>–Checks a code. The default knows WINTER10.
onRemove(code: string) => void–Called when the applied code is removed.
currencystring"EUR"ISO 4217 code.
localestring"en-IE"Formats the saving.
classNamestring–Extra classes on the wrapper.

More commerce parts

All 19
commerce-06 is in UI ProGet UI Pro, €199

Preview

Open the page
In UI Pro: get it, €199 once

With every block and theme. 400+ buyers since 2020. Plans