HtmlForgeX

API Reference

Class

TablerBadgeSpan

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Represents a badge styled span element.

Inheritance

Constructors

public TablerBadgeSpan(String text, Nullable<TablerColor> color, TablerBadgeStyle style = Normal, Nullable<TablerColor> textColor = null) #

Initializes or configures TablerBadgeSpan.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} requiredposition: 1
style HtmlForgeX.TablerBadgeStyle = Normal optionalposition: 2
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 3

Methods

public TablerBadgeSpan PaddingX(TablerSpacing spacing) #
Returns: TablerBadgeSpan

Sets internal horizontal padding for the badge background using Bootstrap px-* scale.

Parameters

spacing HtmlForgeX.TablerSpacing requiredposition: 0
public override String ToString() #
Returns: String

Initializes or configures ToString.

public TablerBadgeSpan WithBackground(RGBColor background, Nullable<TablerColor> textColor = null) #
Returns: TablerBadgeSpan

Sets a custom RGB background color (and optional Tabler text color) for this badge.

Parameters

background HtmlForgeX.RGBColor requiredposition: 0
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 1
WithDot 2 overloads
public TablerBadgeSpan WithDot(RGBColor color) #
Returns: TablerBadgeSpan

Add a small round dot before the text (e.g., for mentions or color swatches).

Parameters

color HtmlForgeX.TablerColor requiredposition: 0
WithDot(HtmlForgeX.RGBColor color) #

Add a small round dot before the text with a custom RGB color.

Parameters

color HtmlForgeX.RGBColor required

Properties

public String Text { get; set; } #

Gets or sets the badge text.

public Nullable<TablerColor> Color { get; set; } #

Gets or sets the badge background color.

public RGBColor CustomBackground { get; set; } #

Optional custom RGB background color. When provided, takes precedence over preset colors.

public Nullable<TablerColor> TextColor { get; set; } #

Gets or sets the badge text color.

public TablerBadgeStyle Style { get; set; } #

Gets or sets the visual style applied to the badge.