--- 
title: Tabs
description: Tabbed content navigation
category: components
alias: navigation tabs
a1Full: true
group: Navigation

module: NxTabsModule
components:
  - name: NxTabComponent
    selector: nx-tab
    inputs:
      - name: closable
        desc: "Whether the tab can be closed. Default: false."
        default: input(false, { transform: booleanAttribute })
        type: "InputSignalWithTransform<boolean, unknown>"
      - name: label
        desc: "Sets the label of the tab shown in the tablist."
        type: "string"
      - name: disabled
        desc: "Sets the tab to disabled."
        type: "BooleanInput"
  - name: NxTabGroupComponent
    selector: nx-tab-group
    inputs:
      - name: selectedIndex
        desc: "Sets the selected tab."
        type: "NumberInput"
      - name: negative
        desc: "Whether the negative set of styling should be used."
        type: "BooleanInput"
      - name: disabled
        desc: "Whether the tab group is disabled. Default: false."
        type: "BooleanInput"
      - name: autoselect
        desc: "Whether the tab should be immediately selected on focus."
        type: "BooleanInput"
      - name: mobileAccordion
        desc: "Whether the tabs should to accordion on mobile viewports. Under A1 the accordion is never shown, regardless of this input."
        type: "BooleanInput"
      - name: appearance
        desc: "**Expert option**  Sets the appearance of the tab group. Default: 'default'."
        type: "'expert' | 'default'"
    outputs:
      - name: selectedIndexChange
        desc: "An event emitted when the selected tab has changed."
        type: "EventEmitter<number>"
      - name: selectedTabChange
        desc: "An event emitted when the selected tab has changed."
        type: "EventEmitter<NxTabChangeEvent>"
      - name: focusChange
        desc: "An event emitted when focus has changed within a tab group.  **Note:** is not supported in mobile view."
        type: "EventEmitter<NxTabChangeEvent>"
    methods:
      - name: updateFocusedIndex
        params:
          - name: index
            type: number
        returnType: void
      - name: focusChanged
        params:
          - name: index
            type: number
        returnType: void
      - name: handleClick
        params:
          - name: index
            type: number
        returnType: void
      - name: getTabIndex
        params:
          - name: tab
            type: NxTabComponent
          - name: idx
            type: number
        desc: "Returns the tabindex for a tab label."
        returnType: number | null
  - name: NxTabLabelDirective
    selector: [nxTabLabel]
  - name: NxTabLabelWrapperDirective
    selector: [nxTabLabelWrapper]
    inputs:
      - name: disabled
        desc: "Whether the tab group is disabled. Default: false."
        type: "BooleanInput"
    methods:
      - name: focus
        params: 
        returnType: void
  - name: NxTabHeaderComponent
    selector: nx-tab-header
    inputs:
      - name: selectedIndex
        type: "number"
      - name: autoselect
        type: "boolean"
    outputs:
      - name: selectFocusedIndex
        type: "EventEmitter<number>"
      - name: indexFocused
        type: "EventEmitter<number>"
    methods:
      - name: focusTab
        params:
          - name: index
            type: number
        desc: "Moves focus to the tab at the given index, or to the nearest enabled tab if that tab is disabled. Returns whether a tab could be focused."
        returnType: boolean
      - name: scrollToButton
        params:
          - name: index
            type: number
        returnType: void
      - name: updateFocusedIndex
        params:
          - name: index
            type: number
        desc: "Syncs the key manager's bookkeeping to a tab that received DOM focus outside of its own keyboard handling (e.g. native Tab/Shift+Tab into the tablist, or a mouse click). Uses `updateActiveItem` rather than `setActiveItem` so it never re-focuses the element the browser already focused."
        returnType: void
      - name: handleKeydown
        params:
          - name: event
            type: KeyboardEvent
        desc: "Handles keyboard inputs on the labels If autoselect is enabled the tab gets changed immediately If autoselect is disabled only the focus changes but the user still has to select the item by himself."
        returnType: void
  - name: NxTabBodyComponent
    selector: nx-tab-body
    inputs:
      - name: tab
        default: input.required<NxTabComponent>()
        type: "InputSignal<NxTabComponent>"
      - name: active
        type: "BooleanInput"
    methods:
      - name: attach
        params: 
        returnType: void
      - name: detach
        params: 
        returnType: void
  - name: NxTabNavBarComponent
    selector: nx-tab-nav-bar
    inputs:
      - name: negative
        desc: "Whether the tab nav bar has negative styling."
        type: "BooleanInput"
      - name: disabled
        desc: "Whether the tab nav bar has disabled styling."
        type: "BooleanInput"
      - name: appearance
        desc: "**Expert option**  Sets the appearance of the tab nav bar. Default: 'default'."
        type: "'expert' | 'default'"
  - name: NxTabLinkDirective
    selector: [nxTabLink]
    inputs:
      - name: active
        desc: "Whether the tab link is active and has the active styling."
        type: "BooleanInput"
      - name: disabled
        desc: "Whether the tab link is disabled. Default: false."
        type: "BooleanInput"
  - name: NxTabContentDirective
    selector: [nxTabContent]
    desc: |
      Decorates the `ng-template` tags and reads out the template from it.
  - name: NxTabHeaderOutletComponent
    selector: nx-tab-header-outlet
    inputs:
      - name: content
        default: input.required<EmbeddedViewRef<any>>()
        type: "InputSignal<EmbeddedViewRef<any>>"
    methods:
      - name: attach
        params: 
        returnType: void
      - name: detach
        params: 
        returnType: void
  - name: NxTabScrollIndicator
    selector: nx-tab-scroll-indicator
    inputs:
      - name: scrollDirection
        default: input.required<NxScrollDirection>()
        type: "InputSignal<'start' | 'end'>"
      - name: isScrolledToStart
        default: input<boolean>()
        type: "InputSignal<boolean | undefined>"
      - name: isScrolledToEnd
        default: input<boolean>()
        type: "InputSignal<boolean | undefined>"
    outputs:
      - name: buttonClicked
        type: "EventEmitter<void>"
    methods:
      - name: getChevronName
        params: 
        returnType: string
      - name: scroll
        params: 
        returnType: void

---