Documentation Index
Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
Use this file to discover all available pages before exploring further.
Auto focus
Automatically focus a field when it loads by setting theautoFocus option to true.
This is useful for focusing the card number field when the payment form first appears.
Only one field should have
autoFocus enabled at a time.Input masking
Mask the values in the card number and security code fields to hide sensitive data. Masking replaces digits with a special character (default•).
Mask on blur
By default, masking is applied when the field loses focus and removed when it regains focus.character:
Real-time masking
To mask the input as the user types, enable themaskOnInput option.
When real-time masking is enabled, each character is briefly shown in plain text as the user types it, then redacted after a short delay. This preview behavior is always on when using real-time masking and is not configurable.
Show last four digits
For card number fields, you can keep the last four digits visible when masking a valid card number by settingshowLastFour to true.
The
showLastFour option is only available on card number fields.Mask input options
| Option | Type | Default | Description |
|---|---|---|---|
character | string | • | The character used to replace digits. |
showLastFour | boolean | false | Keep the last four digits visible when the card number is valid. Only available on card number fields. |
maskOnInput | boolean | false | Mask the input in real-time as the user types, instead of only on blur. |
Programmatic masking
You can also mask and unmask a field programmatically using theredactValue() and
unredactValue() methods. This lets you build a custom show/hide toggle.
Auto advance
Automatically move focus to the next field when the current field’s value is complete and valid.Custom field order
By default, auto advance follows the order: card number, expiry date, security code. You can override this with thefieldOrder option.
fieldOrder are number, expiryDate, and securityCode.
Reset
Each field instance exposes aclear() method to reset its value programmatically.
Scheme icons
Display card scheme icons inside the card number field. Icons update in real-time as the user types and are refined when the API confirms the scheme. Passtrue to show the detected scheme icon along with any additional schemes
(for example co-branded cards):
Scheme icon options
| Option | Type | Default | Description |
|---|---|---|---|
scheme | boolean | false | Show the detected card scheme icon. |
additionalSchemes | boolean | false | Show additional scheme icons for co-branded cards. |
placeholders | boolean | false | Show placeholder icons (Visa, Mastercard, Amex) before a scheme is detected. |
A maximum of 3 icons are visible at any time. In co-branded scenarios, the primary scheme
icon is displayed first, followed by additional schemes. Each icon is 48 px wide with
4 px spacing, so reserve at least 156 px of horizontal space inside the card
number input to fit all 3 icons.