
################
HoopsTabsElement
################

.. js:class:: ui.tabs.HoopsTabsElement

   A tab container component that manages multiple tab panels.
   
   This component provides a tabbed interface where users can switch between different content panels. It handles keyboard navigation, ARIA attributes, and tab selection state management.
   
   Key features:
   
   
   - Automatic tab panel management via slotted ``hoops-tab`` elements
   - Keyboard navigation with arrow keys (Left/Right for horizontal, Up/Down for vertical)
   - Home and End key support for first/last tab navigation
   - ARIA-compliant accessibility with proper roles and attributes
   - Customizable tab positioning (top, bottom, left, right)
   - CSS custom properties for theming
   - Support for disabled tabs
   - Selection by index or by value
   
   .. rubric:: Examples
   
   
   .. code-block:: html
   
      <!-- Basic usage -->
      <hoops-tabs selectedIndex="0">
        <hoops-tab label="Settings" value="settings" icon="⚙️">
          <div>Settings content here</div>
        </hoops-tab>
        <hoops-tab label="Profile" value="profile" icon="👤">
          <div>Profile content here</div>
        </hoops-tab>
      </hoops-tabs>
      
      <!-- With disabled tab -->
      <hoops-tabs>
        <hoops-tab label="Tab 1">Content 1</hoops-tab>
        <hoops-tab label="Tab 2" disabled>Disabled tab</hoops-tab>
        <hoops-tab label="Tab 3">Content 3</hoops-tab>
      </hoops-tabs>
      
      <!-- Position variants -->
      <hoops-tabs position="left">
        <hoops-tab label="Left Tab 1">Content</hoops-tab>
        <hoops-tab label="Left Tab 2">Content</hoops-tab>
      </hoops-tabs>
      
      <script>
        const tabs = document.getElementsByTagName("hoops-tabs")[0];
      
        // Listen for tab changes
        tabs.addEventListener("hoops-tabs-change", (e) => {
          console.log("Selected tab index:", e.detail.selectedIndex);
          console.log("Selected tab value:", e.detail.selectedValue);
        });
      
        // Programmatically select tab by value
        tabs.selectByValue("profile");
      </script>
   
   .. rubric:: Custom Element
   
   
   ``hoops-tabs``
   
   .. rubric:: Attributes
   
   
   **selectedIndex**
   
   
      The index of the currently selected tab (default: 0)
   
   
   **position**
   
   
      Position of the tab headers relative to content (default: 'top')
   
   
   .. rubric:: Slots
   
   
   **- Default slot for \`hoops-tab\` child elements**
   
   .. rubric:: Events
   
   
   **hoops-tabs-change**
   
   
      Emitted when the selected tab changes. Detail contains selectedIndex and selectedValue.
   
   
   .. rubric:: CSS Properties
   
   
   **--hoops-tabs-header-background**
   
   
      Background color of the tab header area
   
   
   **--hoops-tabs-header-border-color**
   
   
      Border color of the tab header
   
   
   **--hoops-tabs-active-indicator-color**
   
   
      Color of the active tab indicator line
   
   
   **--hoops-tabs-active-indicator-height**
   
   
      Height/width of the active tab indicator
   
   
   **--hoops-tabs-gap**
   
   
      Gap between tabs
   
   
   .. rubric:: Since
   
   
   ``2026.1.0``
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~ui.tabs.HoopsTabsElement.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~ui.tabs.HoopsTabsElement.position`
   * :js:data:`~ui.tabs.HoopsTabsElement.selectedIndex`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~ui.tabs.HoopsTabsElement.connectedCallback`
   * :js:meth:`~ui.tabs.HoopsTabsElement.selectByValue`
   * :js:meth:`~ui.tabs.HoopsTabsElement.willUpdate`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: ui.tabs.HoopsTabsElement.constructor

      .. rst-class:: sig-pretty-signature
      
         | HoopsTabsElement(): :js:class:`HoopsTabsElement <ui.tabs.HoopsTabsElement>`
      
      **Returns**\ : :js:class:`HoopsTabsElement <ui.tabs.HoopsTabsElement>`
      



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


.. js:data:: ui.tabs.HoopsTabsElement.position

      .. rst-class:: sig-pretty-signature
      
         | position: (*"left"* | *"right"* | *"top"* | *"bottom"*\ )
      
      Position of the tab headers relative to the content.
      
      .. rubric:: Default
      
      
      `````ts
      'top'
      `````
      



.. js:data:: ui.tabs.HoopsTabsElement.selectedIndex

      .. rst-class:: sig-pretty-signature
      
         | selectedIndex: *number*
      
      The index of the currently selected tab.
      
      .. rubric:: Default
      
      
      `````ts
      0
      `````
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: ui.tabs.HoopsTabsElement.connectedCallback

      .. rst-class:: sig-pretty-signature
      
         | connectedCallback(): *void*
      
      Invoked when the component is added to the document's DOM.
      
      In ``connectedCallback()`` you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.
      
      .. code-block:: ts
      
         connectedCallback() {
           super.connectedCallback();
           addEventListener('keydown', this._handleKeydown);
         }
      
      Typically, anything done in ``connectedCallback()`` should be undone when the element is disconnected, in ``disconnectedCallback()``\ .
      
      **Returns**\ : *void*
      



.. js:method:: ui.tabs.HoopsTabsElement.selectByValue

      .. rst-class:: sig-pretty-signature
      
         | selectByValue(**value**\ : *string*\ ): *void*
      
      Selects a tab by its value property.
      
      **Parameters**
      
      
         **value**\ : *string*
      
      
            The value of the tab to select
      
      
      
      **Returns**\ : *void*
      



.. js:method:: ui.tabs.HoopsTabsElement.willUpdate

      .. rst-class:: sig-pretty-signature
      
         | willUpdate(**changedProperties**\ : (*PropertyValueMap* | *Map*\ )): *void*
      
      Invoked before ``update()`` to compute values needed during the update.
      
      Implement ``willUpdate`` to compute property values that depend on other properties and are used in the rest of the update process.
      
      .. code-block:: ts
      
         willUpdate(changedProperties) {
           // only need to check changed properties for an expensive computation.
           if (changedProperties.has('firstName') || changedProperties.has('lastName')) {
             this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
           }
         }
         
         render() {
           return html`SHA: ${this.sha}`;
         }
      
      **Parameters**
      
      
         **changedProperties**\ : (*PropertyValueMap* \| *Map*\ )
      
      
      **Returns**\ : *void*
      




