File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed
src/components-examples/material/badge/badge-overview Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change
1
+ : host {
2
+ dis play: flex;
3
+ flex- direction: column;
4
+ align- items: flex- start;
5
+ }
6
+
7
+ .demo-section + .demo-section {
8
+ margin-top : 16px ;
9
+ }
Original file line number Diff line number Diff line change 1
- < p >
2
1
<!-- #docregion mat-badge-overlap -->
3
- < span matBadge ="4 " matBadgeOverlap ="false "> Text with a badge</ span >
2
+ < div matBadge ="4 " matBadgeOverlap ="false " class =" demo-section " > Text with a badge</ div >
4
3
<!-- #enddocregion mat-badge-overlap -->
5
- </ p >
6
4
7
- < p >
8
5
<!-- #docregion mat-badge-size -->
9
- < span matBadge ="1 " matBadgeSize ="large "> Text with large badge</ span >
6
+ < div matBadge ="1 " matBadgeSize ="large " class =" demo-section " > Text with large badge</ div >
10
7
<!-- #enddocregion mat-badge-size -->
11
- </ p >
12
8
13
- < p >
9
+ < div class =" demo-section " >
14
10
Button with a badge on the left
15
11
<!-- #docregion mat-badge-position -->
16
12
< button mat-raised-button color ="primary "
17
13
matBadge ="8 " matBadgePosition ="before " matBadgeColor ="accent ">
18
14
Action
19
15
</ button >
20
16
<!-- #enddocregion mat-badge-position -->
21
- </ p >
17
+ </ div >
22
18
23
- < p >
19
+ < div class =" demo-section " >
24
20
Button toggles badge visibility
25
21
<!-- #docregion mat-badge-hide -->
26
22
< button mat-raised-button matBadge ="7 " [matBadgeHidden] ="hidden " (click) ="toggleBadgeVisibility() ">
27
23
Hide
28
24
</ button >
29
25
<!-- #enddocregion mat-badge-hide -->
30
- </ p >
26
+ </ div >
31
27
32
- < p >
28
+ < div class =" demo-section " >
33
29
Icon with a badge
34
30
<!-- #docregion mat-badge-color -->
35
31
< mat-icon matBadge ="15 " matBadgeColor ="warn "> home</ mat-icon >
38
34
< span class ="cdk-visually-hidden ">
39
35
Example with a home icon with overlaid badge showing the number 15
40
36
</ span >
41
- </ p >
42
-
43
-
37
+ </ div >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {Component} from '@angular/core';
6
6
@Component ( {
7
7
selector : 'badge-overview-example' ,
8
8
templateUrl : 'badge-overview-example.html' ,
9
+ styleUrls : [ 'badge-overview-example.css' ] ,
9
10
} )
10
11
export class BadgeOverviewExample {
11
12
hidden = false ;
You can’t perform that action at this time.
0 commit comments