# Accordion Item

**Full documentation:** https://webawesome.com/docs/components/accordion-item


`<wa-accordion-item>`

Experimental [Since 1.0](https://webawesome.com/docs/resources/changelog#wa_100)

Accordion items are used inside [`<wa-accordion>`](https://webawesome.com/docs/components/accordion) to create expandable sections with accessible headers.

This component must be used as a child of [`<wa-accordion>`](https://webawesome.com/docs/components/accordion). Please see the [Accordion docs](https://webawesome.com/docs/components/accordion) to see examples of this component in action.

## Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

\*\*CDN\*\*

Import this component directly from the CDN:

```js
import 'https://ka-f.webawesome.com/webawesome@3.8.0/components/accordion-item/accordion-item.js';
```

\*\*npm\*\*

After installing Web Awesome via npm, import this component:

```js
import '@awesome.me/webawesome/dist/components/accordion-item/accordion-item.js';
```

\*\*Self-Hosted\*\*

If you're self-hosting Web Awesome, import this component from your server:

```js
import './webawesome/dist/components/accordion-item/accordion-item.js';
```

\*\*React\*\*

To import this component for React 18 or below, use the following code:

```js
import WaAccordionItem from '@awesome.me/webawesome/dist/react/accordion-item/index.js';
```

## Slots

Link to This Section

Learn more about [using slots](https://webawesome.com/docs/usage/#slots).

| Name | Description |
| --- | --- |
| (default) | The accordion item's body content. |
| \`icon\` | \`

## Attributes & Properties

Link to This Section

Learn more about [attributes and properties](https://webawesome.com/docs/usage/#attributes-and-properties).

| Name | Description | Reflects |
| --- | --- | --- |
| \`disabled\` disabled | \`boolean\` Disables the accordion item so it can't be toggled. Type Default false | | |
| \`expanded\` expanded | \`boolean\` Expands the accordion item. Type Default false | | |
| \`label\` label | \`label\` The text shown in the header. If you need HTML, use the label slot instead. Type string Default '' | | |

## Methods

Link to This Section

Learn more about [methods](https://webawesome.com/docs/usage/#methods).

| Name | Description | Arguments |
| --- | --- | --- |
| \`collapse()\` | Collapses the accordion item with animation. | |
| \`expand()\` | Expands the accordion item with animation. | |
| \`focus()\` | Focuses the accordion item's trigger button. | \`options: FocusOptions\` |
| \`toggle()\` | Toggles the accordion item's expanded state. | |

## CSS custom properties

Link to This Section

Learn more about [CSS custom properties](https://webawesome.com/docs/usage/#custom-properties).

| Name | Description |
| --- | --- |
| \`--easing\` | \`ease\` The easing of the expand/collapse animation. Default |
| \`--hide-duration\` | \`200ms\` The duration of the collapse animation. Default |
| \`--show-duration\` | \`200ms\` The duration of the expand animation. Default |
| \`--spacing\` | \`var(--wa-space-m)\` The amount of space around and between the item's header and content. Default |
| \`--wa-accordion-divider-color\` | \`var(--wa-color-surface-border)\` The color of the divider between accordion items. Default |

## Custom States

Link to This Section

Learn more about [custom states](https://webawesome.com/docs/usage/#custom-states).

| Name | Description | CSS selector |
| --- | --- | --- |
| \`animating\` | Applied while the panel is animating. | \`:state(animating)\` |

## CSS parts

Link to This Section

Learn more about [CSS parts](https://webawesome.com/docs/usage/#css-parts).

| Name | Description | CSS selector |
| --- | --- | --- |
| \`base\` | The component's base wrapper. | \`::part(base)\` |
| \`button\` | The trigger button that toggles the panel. | \`::part(button)\` |
| \`content\` | The content slot inside the panel. | \`::part(content)\` |
| \`heading\` | \`heading-level="none"\` The heading element wrapping the trigger button. Omitted when . | \`::part(heading)\` |
| \`icon\` | The container that wraps the expand/collapse icon. | \`::part(icon)\` |
| \`label\` | The container that wraps the label. | \`::part(label)\` |
| \`panel\` | The panel that contains the item's content. | \`::part(panel)\` |

## Dependencies

Link to This Section

This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.

-   [`<wa-icon>`](https://webawesome.com/docs/components/icon)

**Need a hand?** Report a bug Ask for help