> ## Documentation Index
> Fetch the complete documentation index at: https://www.beeq.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Accordion

> Accordions let users show and hide sections of related content on a page.

![BEEQ Accordion component overview](https://mintcdn.com/beeq/NwMZMX-_rISftnfp/components/images/accordion/accordion-overview-light.svg?fit=max\&auto=format\&n=NwMZMX-_rISftnfp\&q=85\&s=f697770299d97fd94e6da539164d660c)

Accordion component overview

Accordions organize related content into collapsible sections. Each section has a header that reveals or hides its panel content, helping people scan headings first and open only the information they need.

> [!NOTE]
>
> Use `bq-accordion-group` to wrap multiple `bq-accordion` items when you need to coordinate their behavior — for example, collapsing one when another opens.

## At a glance

* **Best for:** FAQs, advanced settings, grouped secondary information, and long pages where not every section needs to stay open.
* **Use with care:** If people need to compare sections side by side or keep several sections visible while working, an accordion may add friction.
* **Related components:** Use [tabs](https://www.beeq.design/components/tab.md) when content belongs to a small set of peer views, or a simple show/hide pattern when only one section needs to expand.

## When to use

> [card]
>
> Use accordions when
>
> * Related content can be grouped into clearly labeled sections
> * Page length or visual density needs to be reduced without removing content
> * People benefit from scanning headings before deciding what to open

> [card]
>
> Do not use accordions when
>
> * People need to compare content across sections at the same time
> * The content is short enough to show fully without harming readability
> * Most sections are likely to be opened during the same task

> [!TIP]
>
> Choose [`bq-accordion`](https://www.beeq.design/components/accordion) for sections stacked on one page whose panels expand and collapse in place, and [`bq-tab`](https://www.beeq.design/components/tab) for a small set of peer sections where one panel is shown at a time.

## Anatomy

![Accordion anatomy](https://mintcdn.com/beeq/NwMZMX-_rISftnfp/components/images/accordion/accordion-anatomy-light.svg?fit=max\&auto=format\&n=NwMZMX-_rISftnfp\&q=85\&s=131bef26cbf82f8c58a858553aa2dcfb)

Accordion anatomy

Each accordion item includes a clickable header and a collapsible panel. The header should set clear expectations about what the panel contains.

| Part | Element | Description |
| - | - | - |
| **1** | Container | The outer wrapper for the entire accordion item |
| **2** | Header | The clickable trigger that toggles the panel open/closed |
| **3** | Panel | The collapsible area containing the body content |
| **4** | Prefix | An optional suffix like an icon or avatar before the header text for additional context |
| **5** | Suffix | An optional prefix for additional context after the header text (less common than prefix) |
| **6** | Expand/Collapse | Icon indicating the current state of the panel and providing a visual affordance for interactivity |

## Design guidelines

Use accordions to reduce page density without hiding content that people need to complete the task. Keep each header specific, keep panel content focused, and use `bq-accordion-group` when several accordion items should behave as one coordinated set.

## Usage

The examples below cover the most common ways to use accordions in BEEQ. Start with a single accordion item when sections are independent, and use an accordion group when items should behave as one coordinated set.

### Default (collapsed)

Accordion items are collapsed by default. This works best when the heading alone gives enough context for someone to decide whether opening the section is worth it.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion>
  <span slot="header">Accordion title</span>
  <p>This is the accordion panel content. It is hidden by default and revealed when the header is clicked.</p>
</bq-accordion>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

<BqAccordion>
  <span slot="header">Accordion title</span>
  <p>This is the accordion panel content. It is hidden by default and revealed when the header is clicked.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <bq-accordion>
      <span slot="header">Accordion title</span>
      <p>This is the accordion panel content. It is hidden by default and revealed when the header is clicked.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <BqAccordion>
    <span slot="header">Accordion title</span>
    <p>This is the accordion panel content. It is hidden by default and revealed when the header is clicked.</p>
  </BqAccordion>
</template>
```

### Expanded by default

Use the `expanded` attribute when a section should start open — for example when the first item contains the most important information or when one section is expected to be reviewed first.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion expanded>
  <span slot="header">Expanded by default</span>
  <p>This panel is visible when the component first renders.</p>
</bq-accordion>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

<BqAccordion expanded>
  <span slot="header">Expanded by default</span>
  <p>This panel is visible when the component first renders.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <bq-accordion expanded>
      <span slot="header">Expanded by default</span>
      <p>This panel is visible when the component first renders.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <BqAccordion expanded>
    <span slot="header">Expanded by default</span>
    <p>This panel is visible when the component first renders.</p>
  </BqAccordion>
</template>
```

## Options

### Appearance

Two appearance values are available:

* **filled**: (default) adds a background color to the header for a contained look
* **ghost**: removes the background for a minimal style that blends with surrounding content.

**Allowed `appearance` values:** `filled` (default), `ghost`.

> [!TIP]
>
> Since `filled` is the default, there's no need to explicitly set `appearance="filled"` on the component.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<!-- Filled: default, no need to set appearance explicitly -->
<bq-accordion expanded>
  <span slot="header">Filled (default)</span>
  <p>The header has a background color in the filled appearance.</p>
</bq-accordion>

<!-- Ghost: minimal, no header background -->
<bq-accordion appearance="ghost" expanded>
  <span slot="header">Ghost</span>
  <p>The header has no background in the ghost appearance.</p>
</bq-accordion>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

{/* Filled: default */}
<BqAccordion expanded>
  <span slot="header">Filled (default)</span>
  <p>The header has a background color in the filled appearance.</p>
</BqAccordion>

{/* Ghost */}
<BqAccordion appearance="ghost" expanded>
  <span slot="header">Ghost</span>
  <p>The header has no background in the ghost appearance.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <!-- Filled: default -->
    <bq-accordion expanded>
      <span slot="header">Filled (default)</span>
      <p>The header has a background color in the filled appearance.</p>
    </bq-accordion>

    <!-- Ghost -->
    <bq-accordion appearance="ghost" expanded>
      <span slot="header">Ghost</span>
      <p>The header has no background in the ghost appearance.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <!-- Filled: default -->
  <BqAccordion expanded>
    <span slot="header">Filled (default)</span>
    <p>The header has a background color in the filled appearance.</p>
  </BqAccordion>

  <!-- Ghost -->
  <BqAccordion appearance="ghost" expanded>
    <span slot="header">Ghost</span>
    <p>The header has no background in the ghost appearance.</p>
  </BqAccordion>
</template>
```

### Size

Accordions support two sizes: `medium` (default) and `small`.
The `small` size uses more compact padding and a smaller border radius, giving it a tighter look.

**Allowed `size` values:** `small`, `medium` (default).

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion size="medium" expanded>
  <span slot="header">Medium accordion (default)</span>
  <p>This is the medium size — more padding, suitable for most use cases.</p>
</bq-accordion>

<bq-accordion size="small" expanded>
  <span slot="header">Small accordion</span>
  <p>This is the small size — compact padding for dense layouts and using small border radius.</p>
</bq-accordion>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

<BqAccordion size="medium" expanded>
  <span slot="header">Medium accordion (default)</span>
  <p>This is the medium size — more padding, suitable for most use cases.</p>
</BqAccordion>

<BqAccordion size="small" expanded>
  <span slot="header">Small accordion</span>
  <p>This is the small size — compact padding for dense layouts and using small border radius.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <bq-accordion size="medium" expanded>
      <span slot="header">Medium accordion (default)</span>
      <p>This is the medium size — more padding, suitable for most use cases.</p>
    </bq-accordion>

    <bq-accordion size="small" expanded>
      <span slot="header">Small accordion</span>
      <p>This is the small size — compact padding for dense layouts and using small border radius.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <BqAccordion size="medium" expanded>
    <span slot="header">Medium accordion (default)</span>
    <p>This is the medium size — more padding, suitable for most use cases.</p>
  </BqAccordion>

  <BqAccordion size="small" expanded>
    <span slot="header">Small accordion</span>
    <p>This is the small size — compact padding for dense layouts and using small border radius.</p>
  </BqAccordion>
</template>
```

> [!NOTE]
>
> Use the `small` size in dense layouts or sidebars where space is limited.

### Group

Wrap related `bq-accordion` items inside `bq-accordion-group` when they should behave as a coordinated set. By default, only one item can stay open at a time. Add the `multiple` attribute when people may need to keep several sections open while reading or working.

The group also lets you set `appearance`, `size`, and `no-animation` once and have them cascade to all child accordions.

> [!NOTE]
>
> Attributes/Properties set in the group can be overridden by setting them directly on an individual accordion item.

### Single open (default group behavior)

Use the default group behavior when the sections are mutually exclusive or when keeping only one panel open helps reduce distraction.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion-group>
  <bq-accordion>
    <span slot="header">Section one</span>
    <p>Content for section one.</p>
  </bq-accordion>
  <bq-accordion>
    <span slot="header">Section two</span>
    <p>Content for section two.</p>
  </bq-accordion>
  <bq-accordion>
    <span slot="header">Section three</span>
    <p>Content for section three.</p>
  </bq-accordion>
</bq-accordion-group>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion, BqAccordionGroup } from "@beeq/react";

<BqAccordionGroup>
  <BqAccordion>
    <span slot="header">Section one</span>
    <p>Content for section one.</p>
  </BqAccordion>
  <BqAccordion>
    <span slot="header">Section two</span>
    <p>Content for section two.</p>
  </BqAccordion>
  <BqAccordion>
    <span slot="header">Section three</span>
    <p>Content for section three.</p>
  </BqAccordion>
</BqAccordionGroup>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordionGroup, BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordionGroup, BqAccordion],
  template: `
    <bq-accordion-group>
      <bq-accordion>
        <span slot="header">Section one</span>
        <p>Content for section one.</p>
      </bq-accordion>
      <bq-accordion>
        <span slot="header">Section two</span>
        <p>Content for section two.</p>
      </bq-accordion>
      <bq-accordion>
        <span slot="header">Section three</span>
        <p>Content for section three.</p>
      </bq-accordion>
    </bq-accordion-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion, BqAccordionGroup } from "@beeq/vue";
</script>

<template>
  <BqAccordionGroup>
    <BqAccordion>
      <span slot="header">Section one</span>
      <p>Content for section one.</p>
    </BqAccordion>
    <BqAccordion>
      <span slot="header">Section two</span>
      <p>Content for section two.</p>
    </BqAccordion>
    <BqAccordion>
      <span slot="header">Section three</span>
      <p>Content for section three.</p>
    </BqAccordion>
  </BqAccordionGroup>
</template>
```

### Multiple open

Allow multiple sections to stay open when people may need to review, reference, or complete information across several panels at once.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion-group multiple>
  <bq-accordion expanded>
    <span slot="header">Section one</span>
    <p>Content for section one.</p>
  </bq-accordion>
  <bq-accordion expanded>
    <span slot="header">Section two</span>
    <p>Content for section two.</p>
  </bq-accordion>
  <bq-accordion>
    <span slot="header">Section three</span>
    <p>Content for section three.</p>
  </bq-accordion>
</bq-accordion-group>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion, BqAccordionGroup } from "@beeq/react";

<BqAccordionGroup multiple>
  <BqAccordion expanded>
    <span slot="header">Section one</span>
    <p>Content for section one.</p>
  </BqAccordion>
  <BqAccordion expanded>
    <span slot="header">Section two</span>
    <p>Content for section two.</p>
  </BqAccordion>
  <BqAccordion>
    <span slot="header">Section three</span>
    <p>Content for section three.</p>
  </BqAccordion>
</BqAccordionGroup>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordionGroup, BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordionGroup, BqAccordion],
  template: `
    <bq-accordion-group multiple>
      <bq-accordion expanded>
        <span slot="header">Section one</span>
        <p>Content for section one.</p>
      </bq-accordion>
      <bq-accordion expanded>
        <span slot="header">Section two</span>
        <p>Content for section two.</p>
      </bq-accordion>
      <bq-accordion>
        <span slot="header">Section three</span>
        <p>Content for section three.</p>
      </bq-accordion>
    </bq-accordion-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion, BqAccordionGroup } from "@beeq/vue";
</script>

<template>
  <BqAccordionGroup multiple>
    <BqAccordion expanded>
      <span slot="header">Section one</span>
      <p>Content for section one.</p>
    </BqAccordion>
    <BqAccordion expanded>
      <span slot="header">Section two</span>
      <p>Content for section two.</p>
    </BqAccordion>
    <BqAccordion>
      <span slot="header">Section three</span>
      <p>Content for section three.</p>
    </BqAccordion>
  </BqAccordionGroup>
</template>
```

> [!TIP]
>
> Use `expand-all` attribute (`expandAll` prop) on the group to open every accordion simultaneously — useful for print views or when people need to scan all content at once.

### Header slots

Use the `prefix` slot for adding elements like icons or avatars before the header text, and the `suffix` slot for elements after the text.
These provide additional context to help people scan and understand the sections.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<!-- Prefix icon -->
<bq-accordion>
  <bq-icon name="heart" slot="prefix"></bq-icon>
  <span slot="header">With prefix icon</span>
  <p>The header includes an icon in the prefix slot before the title text.</p>
</bq-accordion>

<!-- Prefix avatar -->
<bq-accordion>
  <bq-avatar
    size="xsmall"
    image="https://images.unsplash.com/photo-1524593689594-aae2f26b75ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
    slot="prefix"
  ></bq-avatar>
  <span slot="header">With prefix avatar</span>
  <p>The prefix slot also accepts an avatar for person-related sections.</p>
</bq-accordion>

<!-- Suffix icon -->
<bq-accordion>
  <span slot="header">With suffix icon</span>
  <bq-icon name="gear" slot="suffix"></bq-icon>
  <p>The header includes an icon in the suffix slot after the title text.</p>
</bq-accordion>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion, BqAvatar, BqIcon } from "@beeq/react";

{/* Prefix icon */}
<BqAccordion>
  <BqIcon name="heart" slot="prefix" />
  <span slot="header">With prefix icon</span>
  <p>The header includes an icon in the prefix slot before the title text.</p>
</BqAccordion>

{/* Prefix avatar */}
<BqAccordion>
  <BqAvatar
    size="xsmall"
    image="https://images.unsplash.com/photo-1524593689594-aae2f26b75ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
    slot="prefix"
  />
  <span slot="header">With prefix avatar</span>
  <p>The prefix slot also accepts an avatar for person-related sections.</p>
</BqAccordion>

{/* Suffix icon */}
<BqAccordion>
  <span slot="header">With suffix icon</span>
  <BqIcon name="gear" slot="suffix" />
  <p>The header includes an icon in the suffix slot after the title text.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion, BqIcon, BqAvatar } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion, BqIcon, BqAvatar],
  template: `
    <!-- Prefix icon -->
    <bq-accordion>
      <bq-icon name="heart" slot="prefix"></bq-icon>
      <span slot="header">With prefix icon</span>
      <p>The header includes an icon in the prefix slot before the title text.</p>
    </bq-accordion>

    <!-- Prefix avatar -->
    <bq-accordion>
      <bq-avatar
        size="xsmall"
        image="https://images.unsplash.com/photo-1524593689594-aae2f26b75ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
        slot="prefix"
        ></bq-avatar>
        <span slot="header">With prefix avatar</span>
        <p>The prefix slot also accepts an avatar for person-related sections.</p>
      </bq-accordion>

      <!-- Suffix icon -->
      <bq-accordion>
        <span slot="header">With suffix icon</span>
        <bq-icon name="gear" slot="suffix"></bq-icon>
        <p>The header includes an icon in the suffix slot after the title text.</p>
      </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion, BqAvatar, BqIcon } from "@beeq/vue";
</script>

<template>
  <!-- Prefix icon -->
  <BqAccordion>
    <BqIcon name="heart" slot="prefix" />
    <span slot="header">With prefix icon</span>
    <p>The header includes an icon in the prefix slot before the title text.</p>
  </BqAccordion>

  <!-- Prefix avatar -->
  <BqAccordion>
    <BqAvatar
      size="xsmall"
      image="https://images.unsplash.com/photo-1524593689594-aae2f26b75ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
      slot="prefix"
    />
    <span slot="header">With prefix avatar</span>
    <p>The prefix slot also accepts an avatar for person-related sections.</p>
  </BqAccordion>

  <!-- Suffix icon -->
  <BqAccordion>
    <span slot="header">With suffix icon</span>
    <BqIcon name="gear" slot="suffix" />
    <p>The header includes an icon in the suffix slot after the title text.</p>
  </BqAccordion>
</template>
```

### States

### Disabled

Use `disabled` only when a section is temporarily unavailable. The header will not respond to interaction and the `bqOpen` / `bqClose` events will not fire.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion disabled>
  <span slot="header">Disabled accordion</span>
  <p>This content cannot be accessed while the accordion is disabled.</p>
</bq-accordion>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

<BqAccordion disabled>
  <span slot="header">Disabled accordion</span>
  <p>This content cannot be accessed while the accordion is disabled.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <bq-accordion disabled>
      <span slot="header">Disabled accordion</span>
      <p>This content cannot be accessed while the accordion is disabled.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <BqAccordion disabled>
    <span slot="header">Disabled accordion</span>
    <p>This content cannot be accessed while the accordion is disabled.</p>
  </BqAccordion>
</template>
```

### Animation

By default, accordions animate the panel open and closed with a smooth height transition.
Add the `no-animation` attribute to disable this and make the panel appear/disappear instantly.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<!-- Default: animated -->
<bq-accordion>
  <span slot="header">With animation (default)</span>
  <p>The panel slides open and closed smoothly.</p>
</bq-accordion>

<!-- Instant: no animation -->
<bq-accordion no-animation>
  <span slot="header">No animation</span>
  <p>The panel appears and disappears instantly.</p>
</bq-accordion>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion } from "@beeq/react";

{/* Default: animated */}
<BqAccordion>
  <span slot="header">With animation (default)</span>
  <p>The panel slides open and closed smoothly.</p>
</BqAccordion>

{/* Instant: no animation */}
<BqAccordion noAnimation>
  <span slot="header">No animation</span>
  <p>The panel appears and disappears instantly.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion],
  template: `
    <!-- Default: animated -->
    <bq-accordion>
      <span slot="header">With animation (default)</span>
      <p>The panel slides open and closed smoothly.</p>
    </bq-accordion>

    <!-- Instant: no animation -->
    <bq-accordion no-animation>
      <span slot="header">No animation</span>
      <p>The panel appears and disappears instantly.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion } from "@beeq/vue";
</script>

<template>
  <!-- Default: animated -->
  <BqAccordion>
    <span slot="header">With animation (default)</span>
    <p>The panel slides open and closed smoothly.</p>
  </BqAccordion>

  <!-- Instant: no animation -->
  <BqAccordion noAnimation>
    <span slot="header">No animation</span>
    <p>The panel appears and disappears instantly.</p>
  </BqAccordion>
</template>
```

> [!TIP]
>
> Use `no-animation` when reduced motion is a concern, or as a fallback for users who have `prefers-reduced-motion` set.
> You can also set `no-animation` on `bq-accordion-group` to disable animation for all child accordions at once.

### Custom expand/collapse icons

The accordion provides two separate slots — `expand` and `collapse` — to replace the default plus/minus icons.
Use `expand` for the icon shown when the panel is closed and `collapse` for the icon shown when the panel is open.

Alternatively, combine a single icon in the `expand` slot with the `rotate` prop, which rotates the icon 180° when the accordion opens.

> [!NOTE]
>
> When using a single custom icon with `rotate`, make sure the icon is designed to be recognizable in both orientations (e.g., a caret or arrow)
> and **it's place in the `expand` slot**, as the rotation is applied to that icon when the accordion is expanded.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<!-- Two separate icons: different icon for each state -->
<bq-accordion>
  <bq-icon name="folder-simple" slot="expand"></bq-icon>
  <bq-icon name="folder-open" slot="collapse"></bq-icon>
  <span slot="header">Custom icons for expand and collapse</span>
  <p>This accordion shows an open folder when expanded and a closed folder when collapsed.</p>
</bq-accordion>

<!-- Single icon + rotate: the icon flips 180° on expand -->
<bq-accordion rotate>
  <bq-icon name="caret-up" slot="expand"></bq-icon>
  <span slot="header">Custom icon with rotation</span>
  <p>This accordion uses a single caret icon that rotates 180° when expanded.</p>
</bq-accordion>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion, BqIcon } from "@beeq/react";

{/* Two separate icons */}
<BqAccordion>
  <BqIcon name="folder-simple" slot="expand" />
  <BqIcon name="folder-open" slot="collapse" />
  <span slot="header">Custom icons for expand and collapse</span>
  <p>This accordion shows an open folder when expanded and a closed folder when collapsed.</p>
</BqAccordion>

{/* Single icon + rotate */}
<BqAccordion rotate>
  <BqIcon name="caret-up" slot="expand" />
  <span slot="header">Custom icon with rotation</span>
  <p>This accordion uses a single caret icon that rotates 180° when expanded.</p>
</BqAccordion>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordion, BqIcon } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordion, BqIcon],
  template: `
    <!-- Two separate icons -->
    <bq-accordion>
      <bq-icon name="folder-simple" slot="expand"></bq-icon>
      <bq-icon name="folder-open" slot="collapse"></bq-icon>
      <span slot="header">Custom icons for expand and collapse</span>
      <p>This accordion shows an open folder when expanded and a closed folder when collapsed.</p>
    </bq-accordion>

    <!-- Single icon + rotate -->
    <bq-accordion rotate>
      <bq-icon name="caret-up" slot="expand"></bq-icon>
      <span slot="header">Custom icon with rotation</span>
      <p>This accordion uses a single caret icon that rotates 180° when expanded.</p>
    </bq-accordion>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqAccordion, BqIcon } from "@beeq/vue";
</script>

<template>
  <!-- Two separate icons -->
  <BqAccordion>
    <BqIcon name="folder-simple" slot="expand" />
    <BqIcon name="folder-open" slot="collapse" />
    <span slot="header">Custom icons for expand and collapse</span>
    <p>This accordion shows an open folder when expanded and a closed folder when collapsed.</p>
  </BqAccordion>

  <!-- Single icon + rotate -->
  <BqAccordion rotate>
    <BqIcon name="caret-up" slot="expand" />
    <span slot="header">Custom icon with rotation</span>
    <p>This accordion uses a single caret icon that rotates 180° when expanded.</p>
  </BqAccordion>
</template>
```

### Custom header layout

Sometimes customizations are needed to meet some requirements.
For example, having the collapse/expand indicator in front instead of at the end (current position).
Developers can [rely on the exposed shadow DOM parts](https://www.beeq.design/guides/styles.md#component-shadow-dom-parts) of the components to target elements inside it and tweak not only the look & feel but also the layout.

> [!NOTE]
>
> In the example below, we **define a custom CSS class** that targets the header part to reverse the order of the header content and the expand icon, and also applies flexbox styles to space out the header content.
> Then, assuming the custom CSS file is imported in the project, we apply the custom class to the accordion to achieve the desired header layout.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
.my-accordion {
  &::part(header) {
    flex-direction: row-reverse;
  }
  div[slot="header"] {
    display: flex;
    justify-content: space-between;
  }
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-accordion-group appearance="ghost">
  <bq-accordion class="my-accordion" rotate>
    <bq-icon name="caret-down" slot="expand"></bq-icon>
    <div slot="header">
      <span>Order summary</span>
      <span>$123.99</span>
    </div>
    <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
  </bq-accordion>
  <bq-accordion class="my-accordion" rotate>
    <bq-icon name="caret-down" slot="expand"></bq-icon>
    <div slot="header">
      <span>Order summary</span>
      <span>$123.99</span>
    </div>
    <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
  </bq-accordion>
</bq-accordion-group>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqAccordion, BqAccordionGroup, BqIcon } from "@beeq/react";
import "./styles.css";

<BqAccordionGroup appearance="ghost">
  <BqAccordion className="my-accordion" rotate>
    <BqIcon name="caret-down" slot="expand" />
    <div slot="header">
      <span>Order summary</span>
      <span>$123.99</span>
    </div>
    <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
  </BqAccordion>
  <BqAccordion className="my-accordion" rotate>
    <BqIcon name="caret-down" slot="expand" />
    <div slot="header">
      <span>Order summary</span>
      <span>$123.99</span>
    </div>
    <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
  </BqAccordion>
</BqAccordionGroup>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqAccordionGroup, BqAccordion, BqIcon } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqAccordionGroup, BqAccordion, BqIcon],
  template: `
    <bq-accordion-group appearance="ghost">
      <bq-accordion class="my-accordion" rotate>
        <bq-icon name="caret-down" slot="expand"></bq-icon>
        <div slot="header">
          <span>Order summary</span>
          <span>$123.99</span>
        </div>
        <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
      </bq-accordion>
      <bq-accordion class="my-accordion" rotate>
        <bq-icon name="caret-down" slot="expand"></bq-icon>
        <div slot="header">
          <span>Order summary</span>
          <span>$123.99</span>
        </div>
        <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
      </bq-accordion>
    </bq-accordion-group>
  `,
  styles: [`
    .my-accordion {
      &::part(header) {
        flex-direction: row-reverse;
      }
      div[slot="header"] {
        display: flex;
        justify-content: space-between;
      }
    }
  `],
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqAccordionGroup appearance="ghost">
    <BqAccordion class="my-accordion" rotate>
      <BqIcon name="caret-down" slot="expand" />
      <div slot="header">
        <span>Order summary</span>
        <span>$123.99</span>
      </div>
      <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
    </BqAccordion>
    <BqAccordion class="my-accordion" rotate expanded>
      <BqIcon name="caret-down" slot="expand" />
      <div slot="header">
        <span>Order summary</span>
        <span>$123.99</span>
      </div>
      <p>This is an example of a custom header layout using the header slot and CSS part selectors to move the expand icon to the end and space out the header content.</p>
    </BqAccordion>
  </BqAccordionGroup>
</template>

<style>
  .my-accordion {
    &::part(header) {
      flex-direction: row-reverse;
    }
    div[slot="header"] {
      display: flex;
      justify-content: space-between;
    }
  }
</style>
```

## Best practices

> [card]
>
> Do
>
> Write header labels that clearly describe the content inside. People should be able to predict what they will find before opening the section.

> [card]
>
> Don't
>
> Do not nest accordions inside accordion panels. It creates unclear hierarchy and makes interaction patterns harder to follow.

> [card]
>
> Do
>
> Use `bq-accordion-group` when items belong together and their open/close behavior should be coordinated.

> [card]
>
> Don't
>
> Do not hide critical content inside accordions. If the information is essential to the page, it should usually remain visible.

> [card]
>
> Do
>
> Consider `no-animation` or a reduced-motion strategy for workflows where motion may distract or overwhelm.

> [card]
>
> Don't
>
> Do not use an accordion when a simpler show/hide pattern or a tab group would communicate the structure more clearly.

> [card]
>
> Do
>
> Keep panel content focused on the promise made by the header so people can scan and decide quickly.

> [card]
>
> Don't
>
> Do not use vague headers such as "More details" when a specific label would set clearer expectations.

## Accessibility

* **Clear headings** — header labels should describe the panel content clearly enough to be understood before expansion.
* **ARIA support** — the header exposes `aria-expanded`, and the panel visibility is reflected for assistive technologies.
* **Disabled state** — disabled accordions are removed from the tab order, so you should use this state sparingly and explain unavailable content when possible.
* **Reduced motion** — you should use `no-animation` when motion should be minimized, or respect the user's `prefers-reduced-motion` setting.

### Keyboard interaction

The header is a native `<summary>` element exposed with `role="button"`.

| Key | Context | Action |
| - | - | - |
| `Tab` | Header of an enabled accordion | Moves focus to the header and emits `bqFocus` |
| `Shift` + `Tab` | Header of an enabled accordion | Moves focus to the previous focusable element |
| `Enter` | Header focused | Toggles the panel open or closed and emits `bqClick` |
| `Space` | Header focused | Toggles the panel open or closed and emits `bqClick` |
| `Tab` | Disabled accordion | Skipped; the header has `tabindex="-1"` |

### Rules

| Rule | Strength | Verified by |
| - | - | - |
| Write header labels that describe the panel content before it is expanded | SHOULD | manual: compare each header with the content it reveals |
| Use `disabled` sparingly and explain unavailable content nearby | SHOULD | manual: review disabled items and their nearby explanation |
| Set `no-animation` or respect `prefers-reduced-motion` when motion must be minimized | SHOULD | manual: check motion settings and the reduced-motion experience |

## API reference

### `bq-accordion` properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `appearance` | `appearance` | The appearance style of the accordion | `'filled'` \| `'ghost'` | `'filled'` |
| `disabled` | `disabled` | If `true`, the accordion header is not interactive | `boolean` | `false` |
| `expanded` | `expanded` | If `true`, the accordion panel is expanded | `boolean` | `false` |
| `noAnimation` | `no-animation` | If `true`, disables the open/close animation | `boolean` | `false` |
| `rotate` | `rotate` | If `true`, the expand icon rotates 180° when expanded instead of swapping | `boolean` | `false` |
| `size` | `size` | The size of the accordion | `'small'` \| `'medium'` | `'medium'` |

### `bq-accordion-group` properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `appearance` | `appearance` | Appearance style applied to all child accordions | `'filled'` \| `'ghost'` | `'filled'` |
| `expandAll` | `expand-all` | If `true`, all child accordions are expanded | `boolean` | `false` |
| `noAnimation` | `no-animation` | If `true`, disables animation on all child accordions | `boolean` | `false` |
| `multiple` | `multiple` | If `true`, multiple accordion items can be expanded at the same time | `boolean` | `false` |
| `size` | `size` | Size applied to all child accordions | `'small'` \| `'medium'` | `'medium'` |

### Invalid combinations

| Combination | Strength | Result |
| - | - | - |
| Setting `disabled` while `expanded` is `true` | SHOULD NOT | `expanded` resets to `false` |

### Events

| Event | Description | Type |
| - | - | - |
| `bqBlur` | Fires when the accordion loses focus | `CustomEvent<HTMLBqAccordionElement>` |
| `bqClick` | Fires when the accordion header is clicked | `CustomEvent<HTMLBqAccordionElement>` |
| `bqFocus` | Fires when the accordion gets focus | `CustomEvent<HTMLBqAccordionElement>` |
| `bqOpen` | Fires when the accordion panel starts to open | `CustomEvent<HTMLBqAccordionElement>` |
| `bqAfterOpen` | Fires after the open transition has completed | `CustomEvent<HTMLBqAccordionElement>` |
| `bqClose` | Fires when the accordion panel starts to close | `CustomEvent<HTMLBqAccordionElement>` |
| `bqAfterClose` | Fires after the close transition has completed | `CustomEvent<HTMLBqAccordionElement>` |

> [!NOTE]
>
> * In React, prefix events with `on`: `onBqBlur`, `onBqClick`, `onBqFocus`, `onBqOpen`, `onBqClose`, `onBqAfterOpen`, `onBqAfterClose`.
> * In Angular, use the event binding syntax: `(bqBlur)`, `(bqClick)`, `(bqFocus)`, `(bqOpen)`, `(bqClose)`, etc.
> * In Vue, use the `@` shorthand: `@bq-blur`, `@bq-click`, `@bq-focus`, `@bq-open`, `@bq-close`, etc.

### Slots

#### `bq-accordion`

| Slot | Description |
| - | - |
| *(default)* | The panel body content shown when the accordion is expanded |
| `collapse` | Custom icon shown when the accordion is expanded (clicking will collapse) |
| `expand` | Custom icon shown when the accordion is collapsed (clicking will expand) |
| `header` | The accordion header label (the clickable trigger) |
| `prefix` | Content before the header text — icon or avatar |
| `suffix` | Content after the header text — icon or status indicator |

#### `bq-accordion-group`

| Slot | Description |
| - | - |
| *(default)* | One or more `bq-accordion` elements |

### Shadow parts

#### `bq-accordion`

| Part | Description |
| - | - |
| `base` | The `<details>` element wrapping the accordion |
| `header` | The `<summary>` element — the clickable header |
| `panel` | The `<div>` containing the panel body content |
| `prefix` | The `<div>` wrapping the prefix slot content |
| `suffix` | The `<div>` wrapping the suffix slot content |
| `text` | The `<div>` wrapping the header text slot content |

#### `bq-accordion-group`

| Part | Description |
| - | - |
| `base` | The wrapper `<div>` for the accordion group |

### CSS custom properties

**CSS variables**

#### Size

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--small-padding-y` | Small vertical padding | `var(--bq-spacing-xs)` |
| `--bq-accordion--small-padding-start` | Small start padding | `var(--bq-spacing-s)` |
| `--bq-accordion--small-padding-end` | Small end padding | `var(--bq-spacing-s)` |
| `--bq-accordion--small-gap` | Small gap between prefix, title, and suffix | `var(--bq-spacing-xs)` |
| `--bq-accordion--small-radius` | Small border radius | `var(--bq-radius--xs)` |
| `--bq-accordion--medium-padding-y` | Medium vertical padding | `var(--bq-spacing-s)` |
| `--bq-accordion--medium-padding-start` | Medium start padding | `var(--bq-spacing-m)` |
| `--bq-accordion--medium-padding-end` | Medium end padding | `var(--bq-spacing-m)` |
| `--bq-accordion--medium-gap` | Medium gap between prefix, title, and suffix | `var(--bq-spacing-m)` |
| `--bq-accordion--medium-radius` | Medium border radius | `var(--bq-radius--m)` |

#### Border (collapsed state)

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--collapsed-border-color` | Collapsed border color | `transparent` |
| `--bq-accordion--collapsed-border-style` | Collapsed border style | `none` |
| `--bq-accordion--collapsed-border-width` | Collapsed border width | `unset` |

#### Border (expanded state)

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--expanded-border-color` | Expanded border color | `transparent` |
| `--bq-accordion--expanded-border-style` | Expanded border style | `none` |
| `--bq-accordion--expanded-border-width` | Expanded border width | `unset` |

#### Filled appearance

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--filled-collapsed-background` | Filled collapsed header background | `var(--bq-ui--secondary)` |
| `--bq-accordion--filled-collapsed-text-color` | Filled collapsed header text color | `var(--bq-text--primary)` |
| `--bq-accordion--filled-expanded-background` | Filled expanded header background | `var(--bq-ui--brand-alt)` |
| `--bq-accordion--filled-expanded-collapsed-hover` | Base colour of the filled expanded header hover state (mixed with `--bq-hover`) | `var(--bq-ui--secondary)` |
| `--bq-accordion--filled-expanded-text-color` | Filled expanded header text color | `var(--bq-text--primary)` |

#### Ghost appearance

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--ghost-collapsed-background` | Ghost collapsed header background | `transparent` |
| `--bq-accordion--ghost-collapsed-text-color` | Ghost collapsed header text color | `var(--bq-text--primary)` |
| `--bq-accordion--ghost-expanded-background` | Ghost expanded header background | `transparent` |
| `--bq-accordion--ghost-expanded-collapsed-hover` | Base colour of the ghost header hover state, collapsed and expanded (mixed with `--bq-hover`) | `var(--bq-ui--secondary)` |
| `--bq-accordion--ghost-expanded-text-color` | Ghost expanded header text color | `var(--bq-text--brand)` |

#### Icon and panel

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--icon-color` | Expand and collapse icon color | `var(--bq-text--primary)` |
| `--bq-accordion--panel-background` | Panel background | `var(--bq-ui--primary)` |
| `--bq-accordion--panel-text-color` | Panel text color | `var(--bq-text--primary)` |

#### Panel — filled

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--panel-filled-border-color` | Filled panel border color | `var(--bq-stroke--primary)` |
| `--bq-accordion--panel-filled-border-style` | Filled panel border style | `solid` |
| `--bq-accordion--panel-filled-border-width` | Filled panel border width | `var(--bq-stroke-s)` |
| `--bq-accordion--panel-small-filled-padding-y` | Small filled panel vertical padding | `var(--bq-spacing-s)` |
| `--bq-accordion--panel-small-filled-padding-start` | Small filled panel start padding | `var(--bq-spacing-s)` |
| `--bq-accordion--panel-small-filled-padding-end` | Small filled panel end padding | `var(--bq-spacing-s)` |
| `--bq-accordion--panel-medium-filled-padding-y` | Medium filled panel vertical padding | `var(--bq-spacing-m)` |
| `--bq-accordion--panel-medium-filled-padding-start` | Medium filled panel start padding | `var(--bq-spacing-m)` |
| `--bq-accordion--panel-medium-filled-padding-end` | Medium filled panel end padding | `var(--bq-spacing-m)` |

#### Panel — ghost

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion--panel-ghost-border-color` | Ghost panel border color | `transparent` |
| `--bq-accordion--panel-ghost-border-style` | Ghost panel border style | `none` |
| `--bq-accordion--panel-ghost-border-width` | Ghost panel border width | `unset` |
| `--bq-accordion--panel-small-ghost-padding-y` | Small ghost panel vertical padding | `var(--bq-spacing-s)` |
| `--bq-accordion--panel-small-ghost-padding-start` | Small ghost panel start padding | `var(--bq-spacing-l)` |
| `--bq-accordion--panel-small-ghost-padding-end` | Small ghost panel end padding | `var(--bq-spacing-l)` |
| `--bq-accordion--panel-medium-ghost-padding-y` | Medium ghost panel vertical padding | `var(--bq-spacing-m)` |
| `--bq-accordion--panel-medium-ghost-padding-start` | Medium ghost panel start padding | `var(--bq-spacing-xl)` |
| `--bq-accordion--panel-medium-ghost-padding-end` | Medium ghost panel end padding | `var(--bq-spacing-xl)` |

#### Group

| Variable | Description | Default |
| - | - | - |
| `--bq-accordion-group--gap` | Gap between accordion items in a group | `var(--bq-spacing-xs)` |

> [!TIP]
>
> Learn more about [styling with shadow parts](https://www.beeq.design/guides/styles.md#component-shadow-dom-parts) and [CSS custom properties](https://www.beeq.design/guides/styles.md#global-css-custom-properties).

## Resources

Use Storybook to test behavior and states interactively, or review the source if you need implementation details.

> [card] [Interactive playground](https://storybook.beeq.design/?path=/story/components-accordion--default)
>
> Explore all accordion configurations in Storybook

> [card] [Source code](https://github.com/Endava/BEEQ/tree/main/packages/beeq/src/components/accordion)
>
> View the component source on GitHub


## Related topics

- [Changelog](https://www.beeq.design/releases/changelog.md)
- [Tab](https://www.beeq.design/components/tab.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.