Interface HadawiButtonMountOptions

interface HadawiButtonMountOptions {
    container: string | HTMLElement;
    getIntentId: () => string | Promise<string>;
    open?: CheckoutOpenOptions;
    variant?: HadawiButtonVariant;
    size?: HadawiButtonSize;
    label?: HadawiButtonLabel;
    locale?: HadawiButtonLocale;
    showBadge?: boolean;
    showIcon?: boolean;
    disabled?: boolean;
    className?: string;
    onError?: (error: unknown) => void;
}

Properties

container: string | HTMLElement

CSS selector or DOM element to mount into (contents are replaced).

getIntentId: () => string | Promise<string>

Called when the shopper clicks the button. Create the intent on your server, then return its id.

Options forwarded to checkout.open() (defaults to mode: 'popup').

Visual style. Default: primary.

Button size. Default: md.

Button label preset or custom text. Default: split.

UI language. Default: en.

showBadge?: boolean

Show the “Powered by Hadawi” badge under the button. Default: true.

showIcon?: boolean

Show the people / logo icon. Default: true.

disabled?: boolean

Start disabled.

className?: string

Extra class names on the <button> element.

onError?: (error: unknown) => void

Called if getIntentId throws or returns an invalid id.