# Accordion
> Expandable content sections with the new compositional Trigger + Content pattern.
Source: https://shellui.dev/docs/v0.4/components/layout/accordion
v0.3.0 refactors Accordion to a fully compositional subcomponent model. The old `Title` parameter on `AccordionItem` still works, but the new `AccordionTrigger` / `AccordionContent` pattern is recommended. A new `AccordionType` enum controls single vs multiple open mode.
## What changed from v0.2.x
| v0.2.1 | v0.3.0 |
|--------|-------------|
| `content` | `......` |
| No mode control | `Type="AccordionType.Single"` or `AccordionType.Multiple` |
## Installation
```bash
shellui add accordion
```
`accordion-type`, `accordion-item`, `accordion-trigger`, and `accordion-content` are auto-installed as dependencies.
## Usage
### Simple (also supported)
The v0.2.x `Title=` parameter on `AccordionItem` still works. Use this when you don't need custom trigger markup:
```razor
Yes. It adheres to the WAI-ARIA design pattern.
Yes. It comes with default styles.
Yes. Animated with Tailwind CSS transitions.
```
### Compositional (recommended)
```razor
What is ShellUI?
A CLI-first Blazor component library inspired by shadcn/ui.
How do I install?
Run shellui init in your Blazor project.
Does it support dark mode?
Yes, all components use CSS variables and support dark mode out of the box.
```
### Multiple open at once
```razor
Section AContent ASection BContent B
```
### Default open item
```razor
Open by defaultThis item starts expanded.Collapsed by defaultClick to expand.
```
## API Reference
### ``
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Type` | `AccordionType` | `Single` | `Single` — only one item open at a time. `Multiple` — many can be open. |
| `DefaultValue` | `string?` | `null` | Value of the item open by default (matches `AccordionItem.Value` or index for `Title=` items) |
| `Collapsible` | `bool` | `false` | When `true`, clicking an open single item closes it |
| `Class` | `string?` | `null` | Additional CSS classes |
| `ChildContent` | `RenderFragment` | — | `AccordionItem` children |
### ``
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Value` | `string?` | `null` | Identifier used with `DefaultValue` and `Type.Single` tracking |
| `Title` | `string?` | `null` | Simple trigger label — use instead of `AccordionTrigger` when full markup control is not needed |
| `IsOpen` | `bool` | `false` | Initial open state |
| `Disabled` | `bool` | `false` | Prevents toggling |
| `ChildContent` | `RenderFragment` | — | `AccordionTrigger` + `AccordionContent`, or plain content when using `Title=` |
### ``
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `ChildContent` | `RenderFragment` | — | Trigger label content |
### ``
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `ChildContent` | `RenderFragment` | — | Revealed content |
### `AccordionType` enum
| Value | Description |
|-------|-------------|
| `Single` | Only one item can be open at a time (default) |
| `Multiple` | Any number of items can be open simultaneously |