Thankly SDK for JavaScript
    Preparing search index...

    Interface RenderOptions

    Controls how widgets are rendered into a container.

    interface RenderOptions {
        buttonPresets?: { ingredient?: ButtonConfig; tool?: ButtonConfig };
        buttonRenderer?: ButtonRenderer;
        className?: string;
        clearExisting?: boolean;
        defaultStyles?: WidgetStyles;
        enableIngredientImage?: boolean;
        enableMap?: boolean;
        enableProTips?: boolean;
        enableRecommendationHeadingIcon?: boolean;
        enableRecommendationImage?: boolean;
        onAddProductClick?: (
            productName: string,
            itemType: string,
            widget: CapabilityWidget,
        ) => void;
        onWidgetClick?: (widget: CapabilityWidget, item: any) => void;
        onWidgetRender?: (widget: CapabilityWidget, element: HTMLElement) => void;
        signal?: AbortSignal;
        sponsoredLinks?: (widget: CapabilityWidget) => SponsoredLink[];
        styleOverrides?: Partial<WidgetStyles>;
        theme?: WidgetTheme;
    }
    Index
    buttonPresets?: { ingredient?: ButtonConfig; tool?: ButtonConfig }

    Ready-made button configurations.

    Type Declaration

    • Optionalingredient?: ButtonConfig

      Button shown on an ingredient row.

    • Optionaltool?: ButtonConfig

      Button shown on a tool row.

    buttonRenderer?: ButtonRenderer

    Builds each widget's action button.

    className?: string

    Extra class applied to the container.

    clearExisting?: boolean

    Empty the container before rendering.

    defaultStyles?: WidgetStyles

    Base styles to start from.

    enableIngredientImage?: boolean

    Show images beside ingredients.

    enableMap?: boolean

    Render a map across the recommendation widgets.

    enableProTips?: boolean

    Show the pro-tips section.

    enableRecommendationHeadingIcon?: boolean

    Show an icon beside the recommendation heading.

    enableRecommendationImage?: boolean

    Show images on recommendation cards.

    onAddProductClick?: (
        productName: string,
        itemType: string,
        widget: CapabilityWidget,
    ) => void

    Called when the add-product button is used.

    onWidgetClick?: (widget: CapabilityWidget, item: any) => void

    Called when a widget is clicked.

    onWidgetRender?: (widget: CapabilityWidget, element: HTMLElement) => void

    Called after a widget renders.

    signal?: AbortSignal

    Abort when removing the rendered widget to release expiry timers.

    sponsoredLinks?: (widget: CapabilityWidget) => SponsoredLink[]

    Resolves the sponsored links for a widget.

    styleOverrides?: Partial<WidgetStyles>

    Per-element style overrides.

    theme?: WidgetTheme

    Colour and typography overrides.