Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Commit 2477c8d

Browse files
authored
Merge pull request #6466 from IgniteUI/didimmova/update-badge-topic
docs(badge): update value and icon in badge docs
2 parents 13341d1 + fbf14a6 commit 2477c8d

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

en/components/badge.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,16 @@ igx-badge {
142142

143143
### Badge Value and Icon
144144

145-
Use the `[value]` input to display text or a numeric count inside the badge. This is the recommended approach instead of projecting content directly:
145+
Use the `[value]` input to display text or a numeric count inside the badge:
146146

147147
```html
148-
<!-- Recommended -->
149148
<igx-badge [value]="model.value"></igx-badge>
149+
```
150+
151+
Use the `[icon]` input to display an icon inside the badge:
150152

151-
<!-- Avoid -->
152-
<igx-badge>{{ model.value }}</igx-badge>
153+
```html
154+
<igx-badge icon="check" type="success"></igx-badge>
153155
```
154156

155157
When both `[icon]` and `[value]` are set, the badge displays both simultaneously:
@@ -159,10 +161,16 @@ When both `[icon]` and `[value]` are set, the badge displays both simultaneously
159161
<igx-badge icon="check" value="5" type="success"></igx-badge>
160162
```
161163

162-
To display only a numeric value without an icon, make sure `[icon]` is not set:
164+
Or you can project content directly:
163165

164166
```html
165-
<igx-badge [value]="unreadCount" type="info"></igx-badge>
167+
<igx-badge>{{ model.value }}</igx-badge>
168+
169+
<!-- When projecting both icon and text, wrap the text to keep correct padding. -->
170+
<igx-badge>
171+
<igx-icon>bluetooth</igx-icon>
172+
<span>Bluetooth</span>
173+
</igx-badge>
166174
```
167175

168176
### Badge Icon

0 commit comments

Comments
 (0)