app.component.html
<h2>Angular Material - Button toggle group icon only</h2>
<div style="padding: 25px;">
<mat-button-toggle-group #toggleGroup="matButtonToggleGroup">
<mat-button-toggle value="verify" aria-label="Verify the item">
<mat-icon>check_circle</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="star" aria-label="Give a star">
<mat-icon>star</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="delete" aria-label="Delete item">
<mat-icon>delete</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="download" aria-label="Download item">
<mat-icon>download</mat-icon>
</mat-button-toggle>
</mat-button-toggle-group>
</div>
<h1 style="padding-left:25px;" *ngIf="toggleGroup.value">
You selected : {{toggleGroup.value}}
</h1>
app.module.ts [import]
// for material icon
import {MatIconModule} from '@angular/material/icon';
// for material toggle button
import {MatButtonToggleModule} from '@angular/material/button-toggle';
- angular material - Button toggle group appearance
- angular material - How to set Button toggle appearance
- angular material - Icon only Button toggle
- angular material - Vertical Button toggle group
- angular material - How to change vertical Divider height
- angular material - How to change Divider margin
- angular material - How to use Progress spinner
- angular material - How to use Card
- angular material - How to use Tabs
- angular material - How to use custom label in Tabs
- angular material - How to slow Tabs content transition
- angular material - How to get Tabs selected index
- angular material - How to use Tabs selectedTabChange event
- angular material - How to show Badge with icon
- angular material - Badge position before & below after