govuk-frontend
    Preparing search index...

    Class ConfigurableComponent<ConfigurationType, RootElementType>Virtual

    Base Component class

    Centralises the behaviours shared by our components

    Type Parameters

    • ConfigurationType extends Partial<Record<keyof ConfigurationType, unknown>> = ObjectNested
    • RootElementType extends Element & { dataset: DOMStringMap } = HTMLElement

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    elementType: new () => Element = HTMLElement

    Accessors

    Methods

    • Internal Virtual

      configOverride

      Function which defines configuration overrides to prioritize properties from the root element's dataset.

      It should take a subset of configuration as input and return a new configuration object with properties that should be overridden based on the root element's dataset. A Symbol is used for indexing to prevent conflicts.

      Parameters

      Returns Partial<ConfigurationType>

      return - Configuration object