Table of Contents

Class MudBadge

Namespace
MudBlazor
Assembly
MudBlazor.dll

Represents an overlay added to an icon or button to add information such as a number of new items.

public class MudBadge : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudBadge
Implements
Inherited Members
Extension Methods

Constructors

MudBadge()

public MudBadge()

Properties

BadgeAriaLabel

The aria-label for the badge.

[Parameter]
[Category("Behavior")]
public string? BadgeAriaLabel { get; set; }

Property Value

string

Remarks

Defaults to null.

BadgeClass

The CSS classes applied to the badge.

[Parameter]
[Category("Appearance")]
public string? BadgeClass { get; set; }

Property Value

string

Remarks

Defaults to null. You can use spaces to separate multiple classes.

BadgeClassname

protected string BadgeClassname { get; }

Property Value

string

Bordered

Displays a border around the badge.

[Parameter]
[Category("Appearance")]
public bool Bordered { get; set; }

Property Value

bool

Remarks

Defaults to false.

ChildContent

The content within this badge.

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

Color

The color of the badge.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Remarks

Defaults to Default. Theme colors are supported.

Content

The string or int value to display inside the badge.

[Parameter]
[Category("Behavior")]
public object? Content { get; set; }

Property Value

object

Remarks

Supported types are string and int.

Dot

Displays a dot instead of any content.

[Parameter]
[Category("Behavior")]
public bool Dot { get; set; }

Property Value

bool

Remarks

Defaults to false.

Elevation

The size of the drop shadow.

[Parameter]
[Category("Appearance")]
public int Elevation { get; set; }

Property Value

int

Remarks

Defaults to 0. A higher number creates a heavier drop shadow. Use a value of 0 for no shadow.

Icon

The icon to display in the badge.

[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }

Property Value

string

Max

The maximum number allowed in the Content property.

[Parameter]
[Category("Behavior")]
public int Max { get; set; }

Property Value

int

Remarks

Defaults to 99.

OnClick

Occurs when the badge has been clicked.

[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

Origin

The location of the badge.

[Parameter]
[Category("Appearance")]
public Origin Origin { get; set; }

Property Value

Origin

Remarks

Defaults to TopRight.

Overlap

Displays ChildContent over the main badge content.

[Parameter]
[Category("Appearance")]
public bool Overlap { get; set; }

Property Value

bool

Remarks

Defaults to false.

Visible

Displays this badge.

[Parameter]
[Category("Behavior")]
public bool Visible { get; set; }

Property Value

bool

Remarks

Defaults to true.

WrapperClass

protected string WrapperClass { get; }

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

OnParametersSet()

protected override void OnParametersSet()