Skip to content

Commit 09e0d47

Browse files
Copilotkdinev
andauthored
docs(skill): add positioning CSS for badge overlay in Avatar & Badge snippet
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/9bd2aa21-2829-486f-819c-7db526672ea8 Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
1 parent 6649439 commit 09e0d47

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

skills/igniteui-angular-components/references/data-display.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ import { IgxBadgeComponent } from 'igniteui-angular/badge';
136136

137137
```html
138138
<!-- Image avatar with badge overlay -->
139-
<div class="wrapper">
139+
<div class="avatar-badge-container">
140140
<igx-avatar [src]="user.photo" shape="circle" size="large"></igx-avatar>
141141
<igx-badge [type]="'success'" [icon]="'check'"></igx-badge>
142142
</div>
@@ -151,6 +151,21 @@ import { IgxBadgeComponent } from 'igniteui-angular/badge';
151151
<igx-badge [type]="'error'" [value]="unreadCount"></igx-badge>
152152
```
153153

154+
```scss
155+
// Required styles to position the badge as an overlay on the avatar
156+
.avatar-badge-container {
157+
position: relative;
158+
display: inline-flex;
159+
160+
igx-badge {
161+
position: absolute;
162+
bottom: 0;
163+
right: 0;
164+
transform: translate(25%, 25%);
165+
}
166+
}
167+
```
168+
154169
Avatar shapes: `'circle'`, `'rounded'`, `'square'`. Sizes: `'small'`, `'medium'`, `'large'`, or custom CSS.
155170
Badge types: `'default'`, `'info'`, `'success'`, `'warning'`, `'error'`.
156171

0 commit comments

Comments
 (0)