Badge

The <FluentBadge> component is used to highlight an item and attract attention or flag status.

<FluentBadge> wraps the <fluent-badge> element, a web component implementation of a badge leveraging the Fluent UI design system.

Examples

Appearances

Clicking the 'Lightweight' badge will trigger the OnClick event. Clicking the dismiss icon on the 'Bigger' badge will trigger the OnDismissClick event. See the 'Console log' for the generated output.

Example
Lightweight Accent Neutral Red and White Highlight Lowlight Bigger
Download: 

Circular

Example
Circular Circular
Download: 

With custom CSS for Fill and Highlight

The Fill and Color values can be defined as CSS variables with 'highlight' and 'lowlight' variants:


fluent-badge {
    --badge-fill-highlight: #ffd800;
    --badge-fill-lowlight: #333;
    --badge-color-highlight: #000;
    --badge-color-lowlight: #fff;
}
        
Example
Badge Badge
Download: 

In a slot

Example
More options... New!
Download: 

Documentation

FluentBadge Class

Parameters

Name
Type
Default
Description
AppearanceAppearance?
Neutral
Gets or sets the visual appearance. See Appearance
Possible values are Accent, Neutral (default) or Lightweight
BackgroundColorstring?
Gets or sets the background color.
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
Circularbool
False
Gets or sets a value indicating whether the badge is rendered circular.
Colorstring?
Gets or sets the color.
DismissIconIcon?
Gets or sets the icon to be displayed when the badge is cancellable.
By default, a small cross icon is displayed.
DismissTitlestring?
Gets or sets the tooltip to display when hovering over the FluentBadge.DismissIcon icon.
Fillstring?
Gets or sets the background color based on fill value.
Heightstring?
Gets or sets the height of the component.
Widthstring?
Gets or sets the width of the component.

EventCallbacks

Name
Type
Description
OnClickEventCallback<MouseEventArgs>
Event callback for when the badge is clicked.
OnDismissClickEventCallback<MouseEventArgs>
Event callback for when the badge FluentBadge.DismissIcon icon is clicked.
Neutral
Accent
Hypertext
Lightweight
Outline
Stealth
Filled
An error has occurred. This application may no longer respond until reloaded. Reload 🗙