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
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
Content
Gets or sets the text label shown in the badge instead of a count.
[Parameter]
public string? Content { get; set; }
Property Value
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
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
Placement
Gets or sets the corner the badge overlays. Defaults to TopEnd.
[Parameter]
public BadgePlacement Placement { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder