Expansion Panel
Angular Material Expansion Panel reveals or hides content in a collapsible format, useful for managing large amounts of information. Each panel carries a header with a title, an optional description and a chevron that turns as the body slides open, and panels stacked in an accordion can open one at a time or all together. BuilderKit restyles the header, the chevron and the panel surface so the stack matches the rest of the design system.
When the sections are peers that should be read one at a time rather than stacked on top of each other, the tabs component is the better fit.
Example
An accordion of panels where opening one closes the others.
This is the primary content of the panel.
This is the primary content of the panel.
I'm visible because I am open
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>This is the expansion title</mat-panel-title>
</mat-expansion-panel-header>
<p>This is the primary content of the panel.</p>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>This is the expansion title</mat-panel-title>
</mat-expansion-panel-header>
<p>This is the primary content of the panel.</p>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>This is the expansion title</mat-panel-title>
</mat-expansion-panel-header>
<p>This is the primary content of the panel.</p>
</mat-expansion-panel>
</mat-accordion>Multiple open panels
The multi attribute on mat-accordion lets several panels stay open at once.
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon svgIcon="circle-user" />
Personal data
</mat-panel-title>
<mat-panel-description>Type your name and age</mat-panel-description>
</mat-expansion-panel-header>
<div class="flex w-full flex-col gap-y-4">
<mat-form-field class="w-full max-w-sm" subscriptSizing="dynamic">
<mat-label>First name</mat-label>
<input matInput />
</mat-form-field>
<mat-form-field class="w-full max-w-24" subscriptSizing="dynamic">
<mat-label>Age</mat-label>
<input matInput type="number" min="1" />
</mat-form-field>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon svgIcon="calendar" />
Day of the trip
</mat-panel-title>
<mat-panel-description>Inform the date you wish to travel</mat-panel-description>
</mat-expansion-panel-header>
<mat-form-field>
<mat-label>Date</mat-label>
<input matInput [matDatepicker]="picker" (focus)="picker.open()" readonly />
</mat-form-field>
<mat-datepicker #picker></mat-datepicker>
</mat-expansion-panel>
</mat-accordion>Disabled
The disabled attribute keeps a panel closed and dims its header.
<mat-accordion>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon svgIcon="map" />
Destination
</mat-panel-title>
<mat-panel-description>Type the country name</mat-panel-description>
</mat-expansion-panel-header>
<mat-form-field>
<mat-label>Country</mat-label>
<input matInput />
</mat-form-field>
</mat-expansion-panel>
</mat-accordion>Accordion with action buttons
An action row sits along the bottom edge of the open panel, separated from the content by a rule, and holds the buttons that close the step out.
Where the invoices are sent.
The card every renewal is charged to.
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Billing address</mat-panel-title>
</mat-expansion-panel-header>
<p>Where the invoices are sent.</p>
<mat-action-row>
<button matButton>Cancel</button>
<button class="primary" matButton>Save</button>
</mat-action-row>
</mat-expansion-panel>
</mat-accordion>Toggle indicator before the title
The togglePosition="before" input moves the chevron to the start of the header, which reads closer to a file tree.
Free above 50, two to four working days.
<mat-accordion togglePosition="before">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Shipping</mat-panel-title>
</mat-expansion-panel-header>
<p>Free above 50, two to four working days.</p>
</mat-expansion-panel>
</mat-accordion>Hidden toggle indicator
The hideToggle attribute drops the chevron, so the panel looks like plain text until it is clicked.
Thirty days, no questions asked.
<mat-accordion>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>Returns</mat-panel-title>
</mat-expansion-panel-header>
<p>Thirty days, no questions asked.</p>
</mat-expansion-panel>
</mat-accordion>