--- 
title: Comparison Table
description: Product/feature comparison tables
category: components
a1Densities: true
group: Data Display

module: NxComparisonTableModule
components:
  - name: NxComparisonTableComponent
    selector: nx-comparison-table
    inputs:
      - name: responsiveMode
        desc: "Switches viewType detection between viewport-based and container-based."
        default: input<'viewport' | 'container' | undefined>(
      this._defaultOptions?.responsiveMode ?? 'viewport',
    )
        type: "InputSignal<'viewport' | 'container' | undefined>"
      - name: responsiveBreakpoints
        desc: "Breakpoint configuration for container-based responsive behavior."
        default: input<NxComparisonTableBreakpoint[] | undefined>(undefined)
        type: "InputSignal<NxComparisonTableBreakpoint[] | undefined>"
      - name: colorScheme
        desc: "Color scheme of the header and footer rows. Only takes effect in the Allianz One design. Default: 'default'."
        default: input<NxComparisonTableColorScheme>('default')
        type: "InputSignal<any>"
      - name: accentColor
        desc: "Accent hue of the header and footer. Only takes effect with an `accent-attention` color scheme. Default: `'blue'`."
        default: input<NxSurfaceAccentColor>(NX_DEFAULT_SURFACE_ACCENT_COLOR)
        type: "InputSignal<NxSurfaceAccentColor>"
      - name: headlineSize
        desc: "Size for the `nx-comparison-table-header-title` slot of every header cell, overriding the projected `nxHeadline`'s own `size`. A pinned header steps it down one size."
        default: input<'l' | 'xl'>('xl')
        type: "InputSignal<'l' | 'xl'>"
      - name: isError
        type: "boolean"
      - name: selectedIndex
        desc: "Sets which info column is selected."
        type: "NumberInput"
      - name: hiddenIndexes
        desc: "Sets which column is hidden."
        type: "number[]"
      - name: view
        desc: "Sets the layout explicitly. If not specified, a layout will be set based on the viewport."
        type: "'mobile' | 'tablet' | 'desktop' | null | undefined"
    outputs:
      - name: selectedIndexChange
        desc: "An event that is dispatched each time selected index of the table has changed."
        type: "EventEmitter<number>"
    methods:
      - name: scrollNext
        params: 
        desc: "Advance the carousel by one product column toward the end."
        returnType: void
      - name: scrollPrev
        params: 
        desc: "Move the carousel back by one product column toward the start."
        returnType: void
  - name: NxComparisonTableCell
    selector: nx-comparison-table-cell
    inputs:
      - name: index
        type: "number"
      - name: disabledColumn
        desc: "Sets all cells below a header cell to be disabled (disabled column).  **Important**: this property can be set only on header cells."
        type: "BooleanInput"
      - name: type
        desc: "Sets the type of the cell. Default: 'content'."
        type: "'header' | 'content' | 'footer'"
    outputs:
      - name: indexChange
        type: "EventEmitter<number>"
  - name: NxComparisonTableDescriptionCell
    selector: nx-comparison-table-description-cell
  - name: NxComparisonTableIntersectionCell
    selector: nx-comparison-table-intersection-cell
  - name: NxToggleSectionDirective
    selector: [nxComparisonTableToggleSection]
    inputs:
      - name: isExpanded
        desc: "Whether the toggle section is expanded. Default: true."
        type: "boolean"
  - name: NxToggleSectionHeaderComponent
    selector: nx-comparison-table-toggle-section-header
    methods:
      - name: toggle
        params: 
        desc: "Toggles the toggle section."
        returnType: void
  - name: NxComparisonTableRowDirective
    selector: [nxComparisonTableRow]
    inputs:
      - name: type
        desc: "Sets the type of the row. Default: 'content'."
        type: "'header' | 'content' | 'footer'"
      - name: mayStick
        type: "BooleanInput"
  - name: NxComparisonTableSelectButton
    selector: button[nxComparisonTableSelectButton]
    inputs:
      - name: selectedLabel
        desc: "Sets the label that is displayed when the column is selected. Default: 'Selected'."
        type: "string"
      - name: unselectedLabel
        desc: "Sets the label that is displayed when the column is not selected. Default: 'Select'."
        type: "string"
      - name: unselectedClassNames
        desc: "Sets the classNames (style, size and negative) of the unselected button. Default: 'secondary small'."
        type: "string"
      - name: selectedClassNames
        desc: "Sets the classNames (style, size and negative) of the selected button. Default: 'primary small'."
        type: "string"
  - name: NxComparisonTableRowGroupDirective
    selector: [nxComparisonTableRowGroup]
    inputs:
      - name: labelCollapsed
        desc: "Sets the label of the expandable area that is shown when the row group is collapsed."
        type: "string"
      - name: labelExpanded
        desc: "Sets the label of the expandable area that is shown when the row group is expanded."
        type: "string"
      - name: visibleRows
        desc: "Sets the number of rows that are visible when loading the component. Default: 5."
        type: "NumberInput"
      - name: isExpanded
        desc: "Sets the expanded state of the row group"
        type: "BooleanInput"
      - name: useFullRowForExpandableArea
        desc: "**Expert Option**.  Sets if the expandable area uses the full width of the row or leaves out the first column.  Default: `false`."
        type: "BooleanInput"
    outputs:
      - name: isExpandedChange
        desc: "An event emitted every time the expanded state of the group changes"
        type: "EventEmitter<boolean>"
  - name: NxComparisonTablePopularCell
    selector: nx-comparison-table-popular-cell
    inputs:
      - name: accentColor
        desc: "Accent hue of the popular cell. Independent of the table's `accentColor` - the popular cell is always an accent surface and can use a different hue than the header it sits above. Only takes effect in the Allianz One design."
        default: input<NxSurfaceAccentColor>('purple')
        type: "InputSignal<NxSurfaceAccentColor>"
      - name: forColumn
        desc: "Sets the id of the column above which the popular cell should be displayed.  Note: counting starts from 1. If set to 1 the popular cell will appear above the first header column of the table."
        type: "NumberInput"
  - name: NxComparisonTableHeaderTop
    selector: nx-comparison-table-header-top
    desc: |
      The slots are elements rather than attributes on the consumer's own markup for two reasons:
      a forgotten import of an element fails the build (NG8001), where a forgotten attribute
      directive is invisible — projection matches the attribute either way, so the cell would still
      render correctly while the imposed sizes silently never arrive. And the imposed sizes are
      provided here rather than on the cell, so they stop at the slot: a consumer who skips the slots
      and writes their own header markup keeps ownership of every `nxHeadline` and `nx-price` in it,
      at the price of no longer following our design updates automatically.
  - name: NxComparisonTableHeaderEyebrow
    selector: nx-comparison-table-header-eyebrow
  - name: NxComparisonTableHeaderTitle
    selector: nx-comparison-table-header-title
  - name: NxComparisonTableHeaderPrice
    selector: nx-comparison-table-header-price
  - name: NxComparisonTableFeature
    selector: nx-comparison-table-feature
    desc: |
      Shows whether a product includes a feature, as an icon with an optional text.
    inputs:
      - name: type
        desc: "The icon to show. Without a type only the text is shown."
        default: input<NxComparisonTableFeatureType>(null)
        type: "InputSignal<'check' | 'minus' | 'cross' | null>"
      - name: contained
        desc: "Whether the icon is shown on a tinted round background."
        default: input(false, { transform: booleanAttribute })
        type: "InputSignalWithTransform<boolean, unknown>"
      - name: layout
        desc: "Arrangement of icon and text. Default: `'horizontal'`."
        default: input<NxComparisonTableFeatureLayout>('horizontal')
        type: "InputSignal<'horizontal' | 'vertical'>"
      - name: iconAriaLabel
        desc: "Screen reader label of the icon. Defaults to the label for the type from `NxComparisonTableIntl`. Set to an empty string when the text already conveys the meaning."
        default: input<string | undefined>(undefined)
        type: "InputSignal<string | undefined>"

---