Options controlling how the auto-initializer scans and watches a container.

interface AutoOptions {
    onError?: (
        error: unknown,
        component:
            | "accordion"
            | "alert"
            | "checkbox"
            | "tabs"
            | "disclosure"
            | "modal"
            | "drawer"
            | "pagination"
            | "popover"
            | "segmented"
            | "slider"
            | "table"
            | "tooltip"
            | "dropdown"
            | "menu"
            | "combobox"
            | "command"
            | "toc"
            | "toast",
    ) => void;
    watch?: boolean;
}

Properties

Properties

onError?: (
    error: unknown,
    component:
        | "accordion"
        | "alert"
        | "checkbox"
        | "tabs"
        | "disclosure"
        | "modal"
        | "drawer"
        | "pagination"
        | "popover"
        | "segmented"
        | "slider"
        | "table"
        | "tooltip"
        | "dropdown"
        | "menu"
        | "combobox"
        | "command"
        | "toc"
        | "toast",
) => void

Called when an enhancer fails to load or throws while running. One broken component must not stop the others, so failures are reported here instead of rejecting ready. Defaults to console.error.

watch?: boolean

Keep watching the container with a MutationObserver, enhancing markup as it is added and disposing instances whose roots leave the document. Defaults to true.