How to Create an Accordion Component in Angular Using HTML Content Projection

Luka Onikadze
2 min readJul 29, 2023

Modern web applications often use the accordion component to elegantly display large amounts of content in a compact, collapsible manner. Today, we’ll walk through creating an accordion component in Angular that lets you define content directly via HTML.

1. Setting Up the Angular Project

If you haven’t initialized an Angular project yet, do so with the Angular CLI:t

ng new angular-accordion
cd angular-accordion

--

--