Skip to content

fix(badge): clarifying the usage of badge value and icon#6453

Merged
simeonoff merged 6 commits intovnextfrom
badge-update
Apr 16, 2026
Merged

fix(badge): clarifying the usage of badge value and icon#6453
simeonoff merged 6 commits intovnextfrom
badge-update

Conversation

@kdinev
Copy link
Copy Markdown
Member

@kdinev kdinev commented Apr 6, 2026

Closes #

Checklist:

  • check topic's TOC/menu and paragraph headings
  • Include TOC topic labels in topic content has a valuable update, it's new or considered as preview\ beta
  • link to other topics using ../relative/path.md
  • at the References section at the end of the topic add links to topics, samples, etc
  • reference API documentation instead of adding a section with API

  • use valid component names - [Data] Grid, IgxSelectComponent, <igx-combo>
  • use spell checker tool (VS Code, Grammarly, Microsoft Editor)
  • add inline code blocks for the names of classes / tags / properties
  • add language descriptor for the code blocks
  • check broken links (use browser add-on)
  • check if sample is working and fully visible in the topic
  • check if sample is working and fully visible in the StackBlitz
  • check if code blocks match the code in StackBlitz demo


  • do not resolve requested changes (leave that to the reviewer)
  • add pending-localization label when the review of the PR is done
  • add a member from the localization team to translate it

Comment thread en/components/badge.md Outdated
<igx-badge>{{ model.value }}</igx-badge>
```

The `[icon]` input takes precedence over `[value]`. When both inputs are set, the icon is displayed and the value is ignored:
Copy link
Copy Markdown
Contributor

@didimmova didimmova Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not right, they're both displayed

<igx-badge [type]="statusType(cell.value)" [icon]="'check'" [value]="5"></igx-badge>

Image

Copy link
Copy Markdown
Member Author

@kdinev kdinev Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b473bde — the section now correctly states that both icon and value are displayed simultaneously when both are set, removing the incorrect precedence claim.

Copilot AI review requested due to automatic review settings April 15, 2026 12:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Badge component documentation to clarify when to use the badge value vs icon inputs and how they interact.

Changes:

  • Adds a new “Badge Value and Icon” section explaining recommended usage of the value input vs content projection.
  • Documents precedence behavior when both icon and value are set, with examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread en/components/badge.md Outdated
Comment thread en/components/badge.md
Comment on lines +142 to +153
Use the `[value]` input to display text or a numeric count inside the badge. This is the recommended approach instead of projecting content directly:

```html
<!-- Recommended -->
<igx-badge [value]="model.value"></igx-badge>

<!-- Avoid -->
<igx-badge>{{ model.value }}</igx-badge>
```

The `[icon]` input takes precedence over `[value]`. When both inputs are set, the icon is displayed and the value is ignored:

Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section introduces the value input, but later in the same document the “Badge in List” NOTE states that igx-badge has only icon and type inputs. Please update that NOTE (or rephrase it to avoid implying exclusivity) so the page stays internally consistent and doesn’t mislead readers about available inputs.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in b473bde — the NOTE in "Badge in List" now includes the value input alongside icon and type so it's internally consistent with the rest of the page.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kdinev kdinev requested a review from didimmova April 16, 2026 06:53
Comment thread en/components/badge.md Outdated
@didimmova didimmova self-requested a review April 16, 2026 09:06
@simeonoff simeonoff merged commit d0d41b6 into vnext Apr 16, 2026
5 checks passed
@simeonoff simeonoff deleted the badge-update branch April 16, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants