HoopsTabsElement
-
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-tabelements - 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
- Automatic tab panel management via slotted
Constructors
-
ui.tabs.HoopsTabsElement.constructor() - HoopsTabsElement():
HoopsTabsElementReturns:
HoopsTabsElement
Properties
-
ui.tabs.HoopsTabsElement.styles static
styles: CSSResult[]Array of styles to apply to the element. The styles should be defined using the ? tag function, via constructible stylesheets, or imported from native CSS module scripts.
Note on Content Security Policy:
Element styles are implemented with
<style>tags when the browser doesn’t support adopted StyleSheets. To use such<style>tags with the style-src CSP directive, the style-src value must either include ‘unsafe-inline’ ornonce-<base64-value>with<base64-value>replaced be a server-generated nonce.To provide a nonce to use on generated
<style>elements, setwindow.litNonceto a server-generated nonce in your page’s HTML, before loading application code:<script> // Generated and unique per request: window.litNonce = 'a1b2c3d4'; </script>
-
ui.tabs.HoopsTabsElement.position - position: (“left” | “right” | “top” | “bottom”)
Position of the tab headers relative to the content.
-
ui.tabs.HoopsTabsElement.selectedIndex - selectedIndex: number
The index of the currently selected tab.
Methods
-
ui.tabs.HoopsTabsElement.connectedCallback() - 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.connectedCallback() { super.connectedCallback(); addEventListener('keydown', this._handleKeydown); }
Typically, anything done in
connectedCallback()should be undone when the element is disconnected, indisconnectedCallback().Returns: void
-
ui.tabs.HoopsTabsElement.selectByValue() - selectByValue(value: string): void
Selects a tab by its value property.
Parameters
value: string
The value of the tab to selectReturns: void
-
ui.tabs.HoopsTabsElement.willUpdate() - willUpdate(changedProperties: (PropertyValueMap | Map)): void
Invoked before
update()to compute values needed during the update.Implement
willUpdateto compute property values that depend on other properties and are used in the rest of the update process.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