Add/Remove Accordion items in Blazor Accordion Component
13 Aug 20214 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.