UMD Web Utilities Library
    Preparing search index...

    Function createSlot

    • Creates a slot element with a specified name

      Utility for creating HTML slot elements for use in Shadow DOM components.

      Parameters

      • name: string

        The name attribute for the slot

      Returns HTMLSlotElement

      HTMLSlotElement with the specified name

      const headlineSlot = createSlot('headline');
      shadowRoot.appendChild(headlineSlot);