ADK API Reference
    Preparing search index...

    Interface ContainerConfigurator

    Configures how an ADK container is instantiated and loads content.

    Chain the methods to set the container's options, then pass the configurator as the second argument to ConfigBuilder.addContainer.

    interface ContainerConfigurator {
        abstract(isAbstract?: boolean): ContainerConfigurator;
        alignX(alignment: HorizontalAlignment): ContainerConfigurator;
        breakpoints(...names: string[]): ContainerConfigurator;
        enabled(isEnabled?: boolean): ContainerConfigurator;
        extends(containerName: string): ContainerConfigurator;
        lazy(isLazy?: boolean): ContainerConfigurator;
        lazyDistance(distance: number): ContainerConfigurator;
        maxWidth(width: number): ContainerConfigurator;
        panel(isPanel?: boolean): ContainerConfigurator;
        params(params: Record<string, unknown>): ContainerConfigurator;
        provider(providerId: string): ContainerConfigurator;
        sticky(isSticky?: boolean): ContainerConfigurator;
        stickyMarginBottom(margin: number): ContainerConfigurator;
        stickyMarginTop(margin: number): ContainerConfigurator;
        stickyTop(top: string): ContainerConfigurator;
        stickyZIndex(zIndex: number): ContainerConfigurator;
        zIndex(zIndex: number): ContainerConfigurator;
    }
    Index

    Methods

    • Mark the container configuration as abstract so it cannot be instantiated. This is useful for defining base configurations that other containers can inherit from using extends.

      Note

      Containers that are not intended to be instantiated should always be abstract, since the configuration validation will fail for any non-abstract container with incomplete configuration.

      The container is not abstract if not configured.

      Parameters

      • OptionalisAbstract: boolean

        Whether the container is abstract. Defaults to true.

      Returns ContainerConfigurator

    • Restrict the container to named viewport breakpoints configured with ConfigBuilder.addBreakpoint. This means that the container will only load when the viewport fulfills certain width conditions.

      No breakpoints are applied if not configured, meaning the container can load at any viewport width.

      Parameters

      • ...names: string[]

        Breakpoint names.

      Returns ContainerConfigurator

    • Enable or disable the container. Disabled containers are not instantiated.

      The container is enabled if not configured.

      Parameters

      • OptionalisEnabled: boolean

        Whether the container is enabled. Defaults to true.

      Returns ContainerConfigurator

    • Inherit all settings except abstract from another container. Any container can be extended, abstract or not, and inheritance can be chained across multiple containers.

      A setting configured in the extending container takes precedence; otherwise, it is inherited from the parents recursively. Settings are replaced as a whole, meaning Array and Object type settings are not deep-merged.

      No inheritance is applied if not configured.

      Parameters

      • containerName: string

        The name of the configuration to inherit from.

      Returns ContainerConfigurator

    • Postpone loading the container until it is likely that it will be viewable. The container will load when the user scrolls towards it or when it is in the viewport. The distance can be set using lazyDistance.

      Lazy loading is disabled if not configured.

      Parameters

      • OptionalisLazy: boolean

        Whether lazy loading is enabled. Defaults to false.

      Returns ContainerConfigurator

    • Set how close to the viewport a lazy container must be before it loads.

      Defaults to 100px if not configured.

      Parameters

      • distance: number

        An integer distance from the viewport, in pixels, from 0 to 1000 inclusive.

      Returns ContainerConfigurator

    • Limit the container content width in pixels. For grouped placement results, this limits the group as a whole rather than each item individually.

      No width limit is applied if not configured, meaning the content can expand horizontally to fill the available space.

      Parameters

      • width: number

        A non-negative integer maximum content width in pixels.

      Returns ContainerConfigurator

    • Include or exclude the container from the ADK Panel. Excluding is useful for utility containers, e.g. for ad marking, that would otherwise clutter the panel.

      The container is included in the panel if not configured.

      Parameters

      • OptionalisPanel: boolean

        Whether the container is included in the panel. Defaults to true.

      Returns ContainerConfigurator

    • Select the provider that loads content into the container. Configure the provider-specific parameters using params.

      Defaults to adk.placement if not configured.

      Parameters

      • providerId: string

        The provider ID.

      Returns ContainerConfigurator

    • Set the bottom margin for the sticky container's outer position.

      Bottom margin is 0 if not configured.

      Parameters

      • margin: number

        A non-negative integer bottom margin.

      Returns ContainerConfigurator

    • Use another element to limit the sticky container's top position instead of its parent.

      Defaults to the container's parent if not configured.

      Parameters

      • top: string

        The selector for the limiting element.

      Returns ContainerConfigurator