# SbAccordion A collapsible accordion component for organizing content into expandable sections. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Multiple | bool | false | Whether multiple items can be expanded simultaneously | | Class | string? | null | Additional CSS classes | ## Events | Event | Type | Description | |-------|------|-------------| | OnExpandedChanged | EventCallback\\> | Fired when expanded items change | ## Templates / Slots | Slot | Type | Description | |------|------|-------------| | ChildContent | RenderFragment | Accordion items (SbAccordionItem components) | ## CSS Classes - `sb-accordion` - Base class When an item is expanded, its header uses a distinct background (`sb-accordion-item--expanded .sb-accordion-item__header`) so it is visually separated from the content area. ## Examples ### Basic Usage ```razor

Content for section 1

Content for section 2

Content for section 3

``` ### Multiple Expanded ```razor

General info content...

Technical details content...

Support content...

``` ### FAQ Style ```razor @foreach (var faq in faqs) {

@faq.Answer

}
@code { private List faqs = new() { new("What is your return policy?", "We offer 30-day returns..."), new("How do I track my order?", "You can track your order..."), new("Do you ship internationally?", "Yes, we ship to over 100 countries...") }; } ``` ### Default Expanded Use `DefaultExpanded="true"` on an item to have it expanded when the page loads. When `Multiple` is false (default), only one item can be expanded at a time. ```razor

This section is expanded by default when the page loads.

This section starts collapsed.

Final section.

``` ### With Subtitles Use the `Subtitle` slot on `SbAccordionItem` to show a short description below the title. Title and subtitle are stacked vertically in the header. ```razor Manage your personal information Update your profile details. Configure notification preferences Choose which notifications you want to receive. ``` ### With Icons ```razor ``` ### Product Specifications ```razor

@product.Description

Property Value @foreach (var spec in product.Specifications) { @spec.Key @spec.Value } @foreach (var review in product.Reviews) { @review.Author - @review.Rating/5

@review.Comment

}
``` ### Tracking Expanded State ```razor Expanded sections: @expandedCount @code { private int expandedCount = 0; private void HandleExpansionChange(HashSet expanded) { expandedCount = expanded.Count; } } ```