

Every state


default


focus


open


filled


checking


invalid


applied


applied-gbp
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "discount-code" | Id of the input; the error id hangs off it. |
| label | string | "Discount code" | Field label. |
| toggleLabel | string | "Add a discount code" | The disclosure's text while closed. |
| defaultOpen | boolean | false | Start with the field open. |
| defaultCode | string | "" | Start with a code in the field. |
| applied | { code: string; saving: number; description?: string } | null | null | A 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. |
| currency | string | "EUR" | ISO 4217 code. |
| locale | string | "en-IE" | Formats the saving. |
| className | string | – | Extra classes on the wrapper. |
More commerce parts
All 19commerce-06 is in UI ProGet UI Pro, €199


