--- 
title: Accordion
description: Expandable panels for collapsible content sections
category: components
alias: expansion panel, collapse
a1Full: true
group: Layout

module: NxAccordionModule
components:
  - name: NxAccordionDirective
    selector: nx-accordion
    inputs:
      - name: size
        desc: "Sets the size of all panels of the accordion. Takes precedence over `variant`."
        default: input<NxAccordionSize | undefined>(undefined)
        type: "InputSignal<'l' | 'm' | undefined>"
      - name: inverseInput
        desc: "Whether the inverse set of styles, for use on a dark background, is applied."
        default: input(undefined, { transform: booleanAttribute, alias: 'inverse' })
        type: "InputSignalWithTransform<boolean | undefined, unknown>"
      - name: variant
        desc: "Value for the styling that should be chosen.  Default: `'regular'`."
        type: "'regular' | 'light' | 'extra-light'"
      - name: negative
        desc: "Whether the negative set of styles should be used."
        type: "BooleanInput"
      - name: flushAlignment
        type: "boolean"
  - name: NxExpansionPanelComponent
    selector: nx-expansion-panel
    inputs:
      - name: inverseInput
        desc: "Whether the inverse set of styles, for use on a dark background, is applied."
        default: input<boolean | undefined, unknown>(undefined, {
      transform: nxOptionalBooleanAttribute,
      alias: 'inverse',
    })
        type: "InputSignalWithTransform<boolean | undefined, unknown>"
      - name: size
        desc: "Sets the size of this panel. Takes precedence over the panel's `variant` and the accordion's size/variant."
        default: input<NxAccordionSize | undefined>(undefined)
        type: "InputSignal<'l' | 'm' | undefined>"
      - name: scrollIntoViewActive
        desc: "Whether scrollIntoView should be enabled."
        default: input<boolean | undefined>(
      this._defaultOptions?.scrollIntoViewActive,
    )
        type: "InputSignal<boolean | undefined>"
      - name: scrollIntoViewOptions
        desc: "Configuration for the scrollIntoView behaviour after the expand animation is done."
        default: this._defaultOptions?.scrollIntoViewOptions
        type: "ScrollIntoViewOptions | undefined"
      - name: negative
        desc: "Whether the negative set of styles should be used."
        type: "BooleanInput"
      - name: variant
        desc: "Value for the styling that should be chosen. Default: `'regular'`."
        type: "'regular' | 'light' | 'extra-light'"
      - name: flushAlignment
        desc: "Setting flush alignment style: no left/right padding in expansion panel header and body"
        type: "boolean"
    methods:
      - name: getOpenState
        params: 
        returnType: "open" | "closed"
  - name: NxExpansionPanelHeaderComponent
    selector: nx-expansion-panel-header
    methods:
      - name: isExpanded
        params: 
        returnType: boolean
      - name: getOpenState
        params: 
        returnType: string
      - name: toggle
        params: 
        desc: "Toggle the expansion panel."
        returnType: void
      - name: keydown
        params:
          - name: event
            type: KeyboardEvent
        returnType: void
  - name: NxExpansionPanelDescriptionDirective
    selector: nx-expansion-panel-description
    desc: |
      This directive is to be used inside of the NxExpansionPanelHeader component.
  - name: NxExpansionPanelTitleDirective
    selector: nx-expansion-panel-title
    desc: |
      This directive is to be used inside of the NxExpansionPanelHeader component.
  - name: NxExpansionPanelBodyDirective
    selector: [nxExpansionPanelBody]

---