> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overflow.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Options

> Configure required fields, custom validators, and localization.

Every element accepts an options object at creation time. This section documents the cross-cutting knobs that apply to multiple elements: `required`, `validate`, and localization primitives.

For element-specific options, see each element's reference page under [Elements](/payment-elements/elements/overview).

## Cross-cutting knobs

| Option                                                   | Applies to                                                                                                              | Description                                                                                                                 |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [`required`](/payment-elements/options/required)         | `email`, `fullName`, `phone`, `companyName`, `billingAddress`, `shippingAddress`, custom elements                       | Rejects empty inputs at submit time and (for the address family) cascades to individual atoms.                              |
| [`validate`](/payment-elements/options/validate)         | `email`, `fullName`, `phone`, `companyName`, `billingAddress`, `shippingAddress`, `bank` (manual mode), custom elements | Custom synchronous validator that runs on every change, debounced. Takes over the entire validity contract for the element. |
| [`localization`](/payment-elements/options/localization) | address elements, checkout                                                                                              | Country directory, default country, and locale primitives.                                                                  |

## Elements without `required` or `validate`

`card`, `submitButton`, `applePay`, `googlePay`, and `checkout` do not accept `required`, `validate`, or `validateAsync` at the top level or per-field.

* `card` collects gateway-bound data. Every card field is always required; suppress optional fields (`holderName`, `postalCode`) via `fields.<key>.hidden` instead of toggling required-ness.
* `submitButton` has no value to validate.
* Wallet elements drive their own submission through the wallet sheet.
* `checkout` composes other elements; configure `required` and `validate` on the individual slots (`contact.email.required`, `billingAddress.validate`, and so on).

## Validation precedence

Providing a `validate` callback opts the element fully out of built-in checks: the built-in `required` check, the format schema, and any provider-level validity checks (like `phone` E.164 checks) are all skipped. The callback receives every value, including `null` for empty inputs, and owns the entire validity contract.

To keep the built-in checks and add business rules on top, leave `validate` unset and gate your business logic inside your own `onChange` handler or on your server.

## Debouncing

`validate` callbacks run debounced. The default is 250 ms; tune it per-instance:

```javascript theme={null}
new Overflow('live_pub_...', {
  validateDebounceMs: 400,
});
```

The debouncer is latest-wins: rapid keystrokes coalesce into one trailing-edge call against the most recent value. Any pending callback is flushed synchronously on blur and on `submit()`, so submit-time error snapshots are always current.

The synchronous `required` empty check is not debounced. Empty-required state notches immediately on the keystroke that clears the input.

## See also

* [`required`](/payment-elements/options/required)
* [`validate`](/payment-elements/options/validate)
* [Localization](/payment-elements/options/localization)
* [Events overview](/payment-elements/events/overview)
