Add/Remove Accordion Items in Blazor Accordion Component
7 Aug 20234 minutes to read
Accordion can be added/removed dynamically by iteration of the Accordion Items using conditional foreach loop.
In the following demo, initially there are three accordion items in the AccordionItems. On clicking the
Add Item button, a new item is added to the
AccordionItems resulting in the addition of fourth accordion item to the Accordion component. On clicking the
Remove Item, the first item of the
AccordionItems is removed from the Accordion component.