# Accordion
> Stacked sections that expand and collapse, one or several at a time.
Source: https://native.shellui.dev/docs/components/layout/accordion
## Installation
```bash
shellui-native add accordion
```
**Platforms:** MAUI · Avalonia. Also installs `element-extensions`, `accordion-item`, `accordion-trigger`, `accordion-content`, `icon`.
## Usage
### Basic
**MAUI**
```xml
```
**Avalonia**
```xml
```
[Live preview](https://native.shellui.dev/preview/index.html?c=accordion-basic)
## MAUI and Avalonia
On Avalonia the XAML children of `AccordionItem` are collected in `Items`. Otherwise the same.
## API
### Accordion
| Property | Type | Default | Description |
|---|---|---|---|
| `Type` | `AccordionType` | `Single` | `Single` (one open item) or `Multiple`. |
| `Value` | `string` | — | Item open at first; comma-separated values with `Type="Multiple"`. |
| Event | Arguments | Description |
|---|---|---|
| `ItemToggled` | `(string Value, bool IsOpen)` | Fired when any item's open state changes: (value, isOpen). User input only: setting Value, or calling Toggle, from code doesn't raise it. |
| Method | Description |
|---|---|
| `IsOpen(string value)` | Whether the item with this value is open. |
| `Toggle(string value)` | Opens it if closed, closes it if open. |
### AccordionItem
XAML children go to `Items` on Avalonia and `Children` on MAUI.
| Property | Type | Default | Description |
|---|---|---|---|
| `Value` | `string` | — | Identifies the item within its accordion. |
| Event | Arguments | Description |
|---|---|---|
| `OpenChanged` | `bool` | User input only, like the accordion's ItemToggled. |
| Method | Description |
|---|---|
| `Toggle()` | Opens it if closed, closes it if open. |
### AccordionTrigger
XAML children go to `Body`.
| Property | Type | Default | Description |
|---|---|---|---|
| `Text` | `string` | — | Text shown by the component. |
| `Body` | `View` (MAUI) · `Control?` (Avalonia) | `null` | Custom header content instead of `Text`. |
| Method | Description |
|---|---|
| `Activate()` | Does what pressing it does. |
| `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. |
### AccordionContent
XAML children go to `Content`.
No properties of its own.