Components

Sort Header

Angular Material Sort Header adds sorting behavior and visual indicators to tabular data, typically used with the Table component.

Example

Below is an example of how BuilderKit restyles the Angular Material Sort Header and gives it a more modern appearance.

Dessert (100g)
Calories
Fat (g)
Carbs (g)
Protein (g)
Frozen yogurt1596244
Ice cream2379374
Eclair26216246
Cupcake3054674
Gingerbread35616494
<table matSort (matSortChange)="sortData($event)">
<thead>
<tr>
<th mat-sort-header="name">Dessert (100g)</th>
<th mat-sort-header="calories">Calories</th>
<th mat-sort-header="fat">Fat (g)</th>
<th mat-sort-header="carbs">Carbs (g)</th>
<th mat-sort-header="protein">Protein (g)</th>
</tr>
</thead>

<tbody>
@for (dessert of sortedData; track dessert) {
<tr>
<td>{{ dessert.name }}</td>
<td>{{ dessert.calories }}</td>
<td>{{ dessert.fat }}</td>
<td>{{ dessert.carbs }}</td>
<td>{{ dessert.protein }}</td>
</tr>
}
</tbody>
</table>