HtmlForgeX

API Reference

Class

TablerBadge

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Tabler badge component for labels and status indicators

Inheritance

Constructors

TablerBadge 2 overloads
public TablerBadge() #

Initializes a new instance of the TablerBadge class

public TablerBadge(String text) #

Initializes a new instance of the TablerBadge class with text

Parameters

text System.String requiredposition: 0
The text to display in the badge

Methods

AutoSizeIfUnset(HtmlForgeX.TablerBadgeSize arg1) #

Applies a size automatically only when the size wasn't set explicitly.

Parameters

arg1 HtmlForgeX.TablerBadgeSize required
Color 2 overloads
public TablerBadge Color(TablerBadgeColor color) #
Returns: TablerBadge

Set badge color.

Parameters

color HtmlForgeX.TablerBadgeColor requiredposition: 0
Predefined badge color.

Returns

The TablerBadge instance for chaining.

public TablerBadge Color(RGBColor background, RGBColor textColor = null) #
Returns: TablerBadge

Set badge color using a custom RGB color. Optionally set text color for contrast.

Parameters

background HtmlForgeX.RGBColor requiredposition: 0
textColor HtmlForgeX.RGBColor = null optionalposition: 1
public static TablerBadge Create(String text, Action<TablerBadge> configure) #
Returns: TablerBadge

Create badge with fluent configuration.

Parameters

text System.String requiredposition: 0
Initial badge text.
configure System.Action{HtmlForgeX.TablerBadge} requiredposition: 1
Delegate that configures the badge.

Returns

A fully configured TablerBadge instance.

public TablerBadge Href(String href) #
Returns: TablerBadge

Make badge a link.

Parameters

href System.String requiredposition: 0
Target URL.

Returns

The TablerBadge instance for chaining.

public TablerBadge Outline(Boolean outline = true) #
Returns: TablerBadge

Make badge outline only.

Parameters

outline System.Boolean = true optionalposition: 0
Whether to render as outline.

Returns

The TablerBadge instance for chaining.

public TablerBadge PaddingX(TablerSpacing spacing) #
Returns: TablerBadge

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

Parameters

spacing HtmlForgeX.TablerSpacing requiredposition: 0
public TablerBadge Pill(Boolean pill = true) #
Returns: TablerBadge

Make badge pill shaped.

Parameters

pill System.Boolean = true optionalposition: 0
Whether to apply the pill style.

Returns

The TablerBadge instance for chaining.

public TablerBadge Removable(Boolean removable = true) #
Returns: TablerBadge

Add remove button to badge.

Parameters

removable System.Boolean = true optionalposition: 0
Whether to include a remove button.

Returns

The TablerBadge instance for chaining.

public TablerBadge Size(TablerBadgeSize size) #
Returns: TablerBadge

Set badge size.

Parameters

size HtmlForgeX.TablerBadgeSize requiredposition: 0
Size of the badge.

Returns

The TablerBadge instance for chaining.

public TablerBadge Style(TablerBadgeVisualStyle style) #
Returns: TablerBadge

Set badge style.

Parameters

style HtmlForgeX.TablerBadgeVisualStyle requiredposition: 0
Visual style of the badge.

Returns

The TablerBadge instance for chaining.

public override String ToString() #
Returns: String

Renders the badge to HTML string

Returns

HTML representation of the badge

Properties

public String ContainerClasses { get; set; } #

Additional CSS classes for the badge container