ADK API Reference
    Preparing search index...

    Interface ContainerApi

    Provides methods for configuring containers and managing their lifecycle in the DOM.

    interface ContainerApi {
        attach(elem?: TargetElement): Adk;
        config(): ContainerConfigurator;
        detach(elem?: TargetElement): Adk;
        insert(
            containerName: string,
            target: TargetElement,
            command?: InsertCommand,
        ): HTMLElement;
    }
    Index

    Methods

    • Detach containers within a DOM subtree from ADK. Detaching releases ADK's state and runs cleanup, but does not remove the elements from the DOM.

      Note

      This is generally only needed for special cases when manipulating containers dynamically.

      Parameters

      • Optionalelem: TargetElement

        ADK will look for container elements in the subtree of the specified element and detach them. Defaults to Document.body.

      Returns Adk

    • Insert a container element at runtime.

      Warning

      Prefer adding container elements directly to the page HTML when possible. Dynamic insertion depends on the target selector and surrounding DOM remaining stable. Also make sure the website supports adding elements on the fly using raw DOM manipulation.

      Parameters

      • containerName: string

        The name of the container to insert.

      • target: TargetElement

        The target element or selector where the container should be inserted.

      • Optionalcommand: InsertCommand

        The insertion command. Defaults to 'append'.

      Returns HTMLElement

      The newly inserted container element.