Badges are used to inform users of the status of an object or of an action that’s been taken. Use badges to label, categorize, or organize items using keywords that describe them.
Icon
Icon define the name of the Icon to display in the badge.
Type | Default Value |
---|
String | null |
<div class="neutral nv-badge">
<i class="nv-badge-icon nv-icon nv-icon-sun"></i>
</div>
<nv-badge icon="sun"></nv-badge>
<NvBadge icon="sun"></NvBadge>
OnCloseClick
EventCallback called when close button is clicked.
The close button will be displayed when the callback is defined.
Type | Default Value |
---|
EventCallback<MouseEventArgs> | null |
<NVBadge OnCloseClick="@OnCloseClick" Color="primary">badge</NVBadge>
@code {
public void OnCloseClick()
{
Console.WriteLine("Badge -> OnCloseClick");
}
}
<div class="nv-badge primary has-close">
Label
<button class="nv-badge-close nv-btn nv-btn-icon nv-btn-level-1" type="button">
<i class="nv-badge-icon nv-icon nv-icon-x"></i>
</button>
</div>