diff --git a/projects/demo/src/app/pages/accordion/accordion-demo.component.html b/projects/demo/src/app/pages/accordion/accordion-demo.component.html
index 9763bb6b..3de6a03b 100644
--- a/projects/demo/src/app/pages/accordion/accordion-demo.component.html
+++ b/projects/demo/src/app/pages/accordion/accordion-demo.component.html
@@ -2,10 +2,12 @@
- @if (_parentOrSelfHasLeadingIcon()) {
-
+@switch (_parentHeadingLevel()) {
+ @case ('h1') {
+
+
+
}
- {{ summary() }}
- @if (_parentOrSelfHasTrailingIcon()) {
-
+ @case ('h2') {
+
+
+
}
-
+ @case ('h3') {
+
+
+
+ }
+ @case ('h4') {
+
+
+
+ }
+ @case ('h5') {
+
+
+
+ }
+ @case ('h6') {
+
+
+
+ }
+ @default {
+
+
+
+ }
+}
+
+
+
+ @if (_parentOrSelfHasLeadingIcon()) {
+
+ }
+
+ {{ summary() }}
+
+ @if (_parentOrSelfHasTrailingIcon()) {
+
+ }
+
+
this._accordion.hasLeadingIcon() ?? this.hasLeadingIcon());
protected _parentOrSelfHasTrailingIcon = computed(() => this._accordion.hasTrailingIcon() ?? this.hasTrailingIcon());
protected _parentOrSelfDisabled = computed(() => this._accordion.disabled() || this.disabled());
+ protected _parentHeadingLevel = computed(() => this._accordion.headingLevel());
protected _hostClasses = computed(() => this._getHostClasses(
[this._parentOrSelfDisabled() ? 'disabled' : null],
diff --git a/projects/widgets/accordion/accordion.component.ts b/projects/widgets/accordion/accordion.component.ts
index c6e8c14d..20b98808 100644
--- a/projects/widgets/accordion/accordion.component.ts
+++ b/projects/widgets/accordion/accordion.component.ts
@@ -1,6 +1,7 @@
import { IDS_ACCORDION_DEFAULT_CONFIG, IDS_ACCORDION_DEFAULT_CONFIG_FACTORY, IdsAccordionDefaultConfig } from './accordion-defaults';
import { IdsAccordionItemComponent } from './accordion-item/accordion-item.component';
import { IdsAccordionAppearanceType } from './types/accordion-appearance.type';
+import { IdsAccordionHeadingLevelType } from './types/accordion-heading-level.type';
import { CdkAccordion } from '@angular/cdk/accordion';
import { ChangeDetectionStrategy, Component, computed, contentChildren, inject, input, ViewEncapsulation } from '@angular/core';
@@ -10,7 +11,7 @@ import { coerceBooleanAttribute, coerceStringAttribute, ComponentBaseWithDefault
const defaultConfig = IDS_ACCORDION_DEFAULT_CONFIG_FACTORY();
@Component({
- selector: 'ids-accordion',
+ selector: 'ids-accordion, ul[idsAccordion]',
imports: [IdsButtonComponent],
templateUrl: './accordion.component.html',
encapsulation: ViewEncapsulation.None,
@@ -41,6 +42,7 @@ export class IdsAccordionComponent extends ComponentBaseWithDefaults(this._defaultConfig.multi);
+ public headingLevel = input(this._defaultConfig.headingLevel);
public btnSize = input(this._defaultConfig.btnSize);
public btnAppearance = input(this._defaultConfig.btnAppearance);
public btnVariant = input(this._defaultConfig.btnVariant);
@@ -51,8 +53,10 @@ export class IdsAccordionComponent extends ComponentBaseWithDefaults `${this.id()}-collapse-btn`);
protected _hostClasses = computed(() => this._getHostClasses([
+ 'ids-accordion',
this.size(),
this.appearance(),
+ this.headingLevel(),
this.disabled() ? 'disabled' : null,
]));
@@ -86,7 +90,7 @@ export class IdsAccordionComponent extends ComponentBaseWithDefaults item.id() === accordionId);
switch (event.key) {
diff --git a/projects/widgets/accordion/public-api.ts b/projects/widgets/accordion/public-api.ts
index 22461b7d..1cda067d 100644
--- a/projects/widgets/accordion/public-api.ts
+++ b/projects/widgets/accordion/public-api.ts
@@ -1,5 +1,6 @@
export * from './accordion-item/accordion-item.component';
export * from './types/accordion-appearance.type';
+export * from './types/accordion-heading-level.type';
export * from './accordion-animations';
export * from './accordion-defaults';
export * from './accordion.component';
diff --git a/projects/widgets/accordion/types/accordion-heading-level.type.ts b/projects/widgets/accordion/types/accordion-heading-level.type.ts
new file mode 100644
index 00000000..eb7a325f
--- /dev/null
+++ b/projects/widgets/accordion/types/accordion-heading-level.type.ts
@@ -0,0 +1,10 @@
+export const IdsAccordionHeadingLevel = {
+ H1: 'h1',
+ H2: 'h2',
+ H3: 'h3',
+ H4: 'h4',
+ H5: 'h5',
+ H6: 'h6',
+} as const;
+
+export type IdsAccordionHeadingLevelType = (typeof IdsAccordionHeadingLevel)[keyof typeof IdsAccordionHeadingLevel];