app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styles: [`
.mat-badge-content {
background: SeaGreen;
color: LightGreen;
}
`]
})
export class AppComponent { }
app.component.html
<h2 style="padding-top:25px; padding-bottom:50px;">
Angular Material - How to use custom Badge color
</h2>
<span
matBadge="9"
matBadgeOverlap="false"
matBadgeSize="large">
Custom badge color
</span>
app.module.ts [import]
import { MatBadgeModule } from '@angular/material/badge'
- angular material - How to change Progress spinner color
- angular material - How to center Progress spinner
- angular material - How to generate Tabs programmatically
- angular material - How to create & add Tab programmatically
- angular material - Tick interval with step in Slider
- angular material - How to invert Slider
- angular material - How to use Slider input event
- angular material - How to use Slide toggle
- angular material - How to change Slide toggle checked color
- angular material - How to use Badge with text
- angular material - How to change Badge size
- angular material - How to use custom Badge size
- angular material - How to show Badge in a button
- angular material - How to show Badge with icon
- angular material - Badge position before & below after