Table of Contents

Class TwBadge

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

Represents an overlay badge that wraps content - an icon, avatar or button - and overlays a count, text label or dot on one of its corners.

public class TwBadge : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
Inheritance
TwBadge
Implements
Inherited Members

Constructors

TwBadge()

public TwBadge()

Properties

ChildContent

Gets or sets the content the badge overlays, such as an icon, avatar or button.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Color

Gets or sets the color of the badge. Defaults to Primary (the app's primary/purple).

[Parameter]
public Color Color { get; set; }

Property Value

Color

Content

Gets or sets the text label shown in the badge instead of a count.

[Parameter]
public string? Content { get; set; }

Property Value

string

Count

Gets or sets the numeric value shown in the badge.

[Parameter]
public int? Count { get; set; }

Property Value

int?

Dot

Gets or sets whether to render a dot instead of a count or label.

[Parameter]
public bool Dot { get; set; }

Property Value

bool

Max

Gets or sets the maximum value shown before the badge caps at "{Max}+". Defaults to 99.

[Parameter]
public int Max { get; set; }

Property Value

int

Placement

Gets or sets the corner the badge overlays. Defaults to TopEnd.

[Parameter]
public BadgePlacement Placement { get; set; }

Property Value

BadgePlacement

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder