Class Tabs

All Implemented Interfaces:
Iterable<Tab>, Attachable, ElementAttributeMethods<HTMLElement, Tabs>, ElementClassListMethods<HTMLElement, Tabs>, ElementConsumerMethods<HTMLElement, Tabs>, ElementContainerMethods<HTMLElement, Tabs>, ElementEventMethods<HTMLElement, Tabs>, ElementIdMethods<HTMLElement, Tabs>, ElementQueryMethods<HTMLElement>, HTMLElementAttributeMethods<HTMLElement, Tabs>, HTMLElementDataMethods<HTMLElement, Tabs>, HTMLElementStyleMethods<HTMLElement, Tabs>, HTMLElementVisibilityMethods<HTMLElement, Tabs>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, Tabs>, Component, Expandable<HTMLElement, Tabs>, HasItems<HTMLElement, Tabs, Tab>, Modifiers.Box<HTMLElement, Tabs>, Modifiers.Fill<HTMLElement, Tabs>, Modifiers.PageInsets<HTMLElement, Tabs>, Modifiers.Secondary<HTMLElement, Tabs>, Modifiers.Vertical<HTMLElement, Tabs>

  • Method Details

    • tabs

      public static Tabs tabs()
    • tabs

      public static <E extends HTMLElement> Tabs tabs(HTMLContainerBuilder<E> builder)
    • attach

      public void attach(MutationRecord mutationRecord)
      Specified by:
      attach in interface Attachable
    • detach

      public void detach(MutationRecord mutationRecord)
      Specified by:
      detach in interface Attachable
    • addItems

      public <T> Tabs addItems(Iterable<T> items, Function<T,Tab> display)
      Description copied from interface: HasItems
      Adds a collection of items to the component. The method applies the provided function to each item in the given iterable to transform it into a subcomponent, which is then added to the component.
      Specified by:
      addItems in interface HasItems<HTMLElement, Tabs, Tab>
      Type Parameters:
      T - the type of the items in the iterable
      Parameters:
      items - the iterable collection of items to be added
      display - the function used to transform each item into a subcomponent
      Returns:
      the builder instance after adding the items
    • add

      public Tabs add(Tab tab)
      Description copied from interface: HasItems
      Adds an item to the component.
      Specified by:
      add in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      tab - the item to be added to the component
      Returns:
      the builder instance after the item has been added
    • box

      public Tabs box(boolean box)
      Description copied from interface: Modifiers.Box
      Adds/removes modifier(box)
      Specified by:
      box in interface Modifiers.Box<HTMLElement, Tabs>
    • closeable

      public Tabs closeable()
    • closeable

      public Tabs closeable(CloseHandler<Tab> closeHandler)
    • expandable

      public Tabs expandable(ExpandableModifier expandable)
      Same as expandable(breakpoints(default_, expandable))
    • expandable

      public Tabs expandable(Breakpoints<ExpandableModifier> expandable)
      Enable expandable vertical tabs at various breakpoints (Modifiers.Vertical.vertical() should be set to true for this to work).
    • fill

      public Tabs fill(boolean fill)
      Description copied from interface: Modifiers.Fill
      Adds/removes modifier(fill)
      Specified by:
      fill in interface Modifiers.Fill<HTMLElement, Tabs>
    • inset

      public Tabs inset(Inset inset)
      Same as inset(breakpoints(default_, inset))
    • inset

      public Tabs inset(Breakpoints<Inset> inset)
      Insets at various breakpoints.
    • noBorderBottom

      public Tabs noBorderBottom()
    • noBorderBottom

      public Tabs noBorderBottom(boolean noBorderBottom)
      Disables border bottom tab styling on tabs. Defaults to false. To remove the bottom border, set this prop to true.
    • pageInsets

      public Tabs pageInsets(boolean pageInsets)
      Description copied from interface: Modifiers.PageInsets
      Specified by:
      pageInsets in interface Modifiers.PageInsets<HTMLElement, Tabs>
    • overflowHorizontal

      public Tabs overflowHorizontal()
      Flag which places overflowing tabs into a menu triggered by the last tab. Unlike other flags, this can only be turned on, but not off.
    • overflowHorizontal

      public Tabs overflowHorizontal(String overflowText)
      Flag which places overflowing tabs into a menu triggered by the last tab. Unlike other flags, this can only be turned on, but not off.
    • noInitialSelection

      public Tabs noInitialSelection()
      By default, the first tab is selected initially. Call this method to disable thi default behaviour.
    • initialSelection

      public Tabs initialSelection(String identifier)
    • secondary

      public Tabs secondary(boolean secondary)
      Enables secondary styling to the tab component
      Specified by:
      secondary in interface Modifiers.Secondary<HTMLElement, Tabs>
    • showTabCount

      public Tabs showTabCount()
    • showTabCount

      public Tabs showTabCount(boolean showTabCount)
      Flag which shows the count of overflowing tabs when enabled
    • subtab

      public Tabs subtab()
      Same as subtab(true)
    • subtab

      public Tabs subtab(boolean subtab)
      Adds/removes modifier(subtab)
    • toggleText

      public Tabs toggleText(String text)
      Text that appears in the expandable toggle. If not set, the text of the selected tab is used.
    • vertical

      public Tabs vertical(boolean vertical)
      Description copied from interface: Modifiers.Vertical
      Adds/removes modifier(vertical)
      Specified by:
      vertical in interface Modifiers.Vertical<HTMLElement, Tabs>
    • that

      public Tabs that()
      Specified by:
      that in interface TypedBuilder<HTMLElement, Tabs>
    • ariaLabel

      public Tabs ariaLabel(String label)
      Provides an accessible label for the tabs. Labels should be unique for each set of tabs that are present on a page. When component is set to nav, this prop should be defined to differentiate the tabs from other navigation regions on the page.
    • ariaAddLabel

      public Tabs ariaAddLabel(String label)
      Aria-label for the add button.
    • ariaScrollBackLabel

      public Tabs ariaScrollBackLabel(String label)
      Aria-label for the back scroll button
    • ariaScrollForwardLabel

      public Tabs ariaScrollForwardLabel(String label)
      Aria-label for the forward scroll button
    • ariaOverflowLabel

      public Tabs ariaOverflowLabel(String label)
      The aria label applied to the button which toggles the tab overflow menu
    • ariaToggleLabel

      public Tabs ariaToggleLabel(String label)
      Aria-label for the expandable toggle
    • onAdd

      public Tabs onAdd(AddItemHandler<Tabs,Tab> onAdd)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever a new item is added to the component.
      Specified by:
      onAdd in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      onAdd - a AddItemHandler that takes the builder instance and the item being added as arguments
      Returns:
      the builder instance after adding the callback
    • onAdd

      public Tabs onAdd(Function<Tabs,Tab> addFunction)
      Callback for the 'add' button. Passing this property inserts the 'add' button.
    • onClose

      public Tabs onClose(CloseHandler<Tab> closeHandler)
    • onUpdate

      public Tabs onUpdate(UpdateItemHandler<Tabs,Tab> onUpdate)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is updated in the component.
      Specified by:
      onUpdate in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      onUpdate - a UpdateItemHandler that takes the component, the previous state of the item, and the updated state of the item as arguments
      Returns:
      the builder instance after adding the callback
    • onRemove

      public Tabs onRemove(RemoveItemHandler<Tabs,Tab> onRemove)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is removed from the component.
      Specified by:
      onRemove in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      onRemove - a RemoveItemHandler that takes the component and the item being removed as arguments
      Returns:
      the builder instance after adding the callback
    • onSelect

      public Tabs onSelect(SelectHandler<Tab> selectHandler)
    • onToggle

      public Tabs onToggle(ToggleHandler<Tabs> toggleHandler)
    • expanded

      public boolean expanded()
      Specified by:
      expanded in interface Expandable<HTMLElement, Tabs>
      Returns:
      true if the element's class list has the modifier Classes.expanded, false otherwise.
    • collapse

      public void collapse(boolean fireEvent)
      Specified by:
      collapse in interface Expandable<HTMLElement, Tabs>
    • expand

      public void expand(boolean fireEvent)
      Specified by:
      expand in interface Expandable<HTMLElement, Tabs>
    • close

      public void close(String identifier)
    • close

      public void close(Tab tab)
    • select

      public void select(String identifier)
    • select

      public void select(String identifier, boolean fireEvent)
    • select

      public void select(Tab tab)
    • select

      public void select(Tab tab, boolean fireEvent)
    • currentTab

      public Tab currentTab()
    • tab

      public Tab tab(String id)
    • iterator

      public Iterator<Tab> iterator()
      Specified by:
      iterator in interface Iterable<Tab>
    • size

      public int size()
      Description copied from interface: HasItems
      Retrieves the total number of items currently contained in the component.
      Specified by:
      size in interface HasItems<HTMLElement, Tabs, Tab>
      Returns:
      the number of items contained in the component
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HasItems
      Checks whether the collection of items in the component is empty.
      Specified by:
      isEmpty in interface HasItems<HTMLElement, Tabs, Tab>
      Returns:
      true if the component contains no items; false otherwise
    • contains

      public boolean contains(String identifier)
      Description copied from interface: HasItems
      Checks whether the component contains an item associated with the given identifier.
      Specified by:
      contains in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      identifier - the identifier of the item to be checked
      Returns:
      true if the component contains an item associated with the provided identifier, false otherwise
    • item

      public Tab item(String identifier)
      Description copied from interface: HasItems
      Retrieves the item associated with the specified identifier from the component.
      Specified by:
      item in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      identifier - the identifier of the item to be retrieved
      Returns:
      the item associated with the given identifier, or null if no item is found
    • updateItem

      public void updateItem(Tab item)
      Description copied from interface: HasItems
      Updates an existing item in the component.
      Specified by:
      updateItem in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      item - the item to be updated
    • removeItem

      public void removeItem(String identifier)
      Description copied from interface: HasItems
      Removes an item from the component based on the provided identifier.
      Specified by:
      removeItem in interface HasItems<HTMLElement, Tabs, Tab>
      Parameters:
      identifier - the identifier of the item to be removed
    • clear

      public void clear()
      Description copied from interface: HasItems
      Clears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.
      Specified by:
      clear in interface HasItems<HTMLElement, Tabs, Tab>