HtmlForgeX

API Reference

Class

InlineText

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Tiny fluent builder for inline rich text (colored runs, spaces, separators). Produces a single span container with nested span runs.

Inheritance

Constructors

Methods

public InlineText Badge(String text, RGBColor background, TablerBadgeStyle style = Pill, Nullable<TablerColor> textColor = null) #
Returns: InlineText

Add a Tabler badge chip with custom RGB background.

Parameters

text System.String requiredposition: 0
background HtmlForgeX.RGBColor requiredposition: 1
style HtmlForgeX.TablerBadgeStyle = Pill optionalposition: 2
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 3
Bold 4 overloads
public InlineText Bold(String text, RGBColor color) #
Returns: InlineText

Adds a bold text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
Bold(System.String text, HtmlForgeX.RGBColor color) #

Adds a bold text run with an RGB color.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
public InlineText Bold(String text, FontWeight weight, RGBColor color) #
Returns: InlineText

Bold with configurable weight and color.

Parameters

text System.String requiredposition: 0
weight HtmlForgeX.FontWeight requiredposition: 1
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 2
Bold(System.String text, HtmlForgeX.FontWeight weight, HtmlForgeX.RGBColor color) #

Bold run with a specific weight and RGB color.

Parameters

text System.String required
weight HtmlForgeX.FontWeight required
color HtmlForgeX.RGBColor required
public Element Build() #
Returns: Element

Builds the underlying element representing the inline text.

Code 2 overloads
public InlineText Code(String text) #
Returns: InlineText

Add inline code (monospace) run.

Parameters

text System.String requiredposition: 0
public InlineText Code(String text, CodeRunStyle style) #
Returns: InlineText

Code or keyboard shortcut run; Keyboard uses <kbd>.

Parameters

text System.String requiredposition: 0
style HtmlForgeX.CodeRunStyle requiredposition: 1
public InlineText Em(String text, Nullable<TablerColor> color = null) #
Returns: InlineText

Adds an emphasized (italic) run, optional Tabler color.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 1
Highlight 2 overloads
public InlineText Highlight(String text, RGBColor color) #
Returns: InlineText

Highlight text using the <mark> element. Optional color sets the background.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
Highlight(System.String text, HtmlForgeX.RGBColor color) #

RGB overload of Highlight.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
Italic 2 overloads
public InlineText Italic(String text, RGBColor color) #
Returns: InlineText

Adds an italic text run.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
Italic(System.String text, HtmlForgeX.RGBColor color) #

Adds an italic text run with an RGB color.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
Link 4 overloads
public InlineText Muted(String text) #
Returns: InlineText

Adds a muted text run.

Parameters

text System.String requiredposition: 0
public InlineText Nbsp(Int32 count = 1) #
Returns: InlineText

Adds one or more non‑breaking spaces.

Parameters

count System.Int32 = 1 optionalposition: 0
public InlineText Raw(String text) #
Returns: InlineText

Adds raw text (no styling).

Parameters

text System.String requiredposition: 0
Run 2 overloads
public InlineText Run(String text, RGBColor color, Boolean underline = false, Boolean italic = false, Boolean bold = false) #
Returns: InlineText

Adds a plain text run within a span, with optional text color and basic flags. Prefer using Boolean) for colored or dotted underlines, or CodeRunStyle>) when you want a single entry point.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
underline System.Boolean = false optionalposition: 2
italic System.Boolean = false optionalposition: 3
bold System.Boolean = false optionalposition: 4
Run(System.String text, HtmlForgeX.RGBColor color, System.Boolean underline, System.Boolean italic, System.Boolean bold) #

Run overload using RGBColor.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
underline System.Boolean required
italic System.Boolean required
bold System.Boolean required
public InlineText Sep(DataGridSeparatorStyle style = Middot, String gap = null) #
Returns: InlineText

Adds a configurable separator with balanced spacing.

Parameters

style HtmlForgeX.DataGridSeparatorStyle = Middot optionalposition: 0
gap System.String = null optionalposition: 1
public InlineText Small(String text) #
Returns: InlineText

Small text run using <small>.

Parameters

text System.String requiredposition: 0
SoftBadge 2 overloads
public InlineText SoftBadge(String text, TablerColor color) #
Returns: InlineText

Convenience for a soft (light) badge using TablerColor.

Parameters

text System.String requiredposition: 0
color HtmlForgeX.TablerColor requiredposition: 1
public InlineText SoftBadge(String text, RGBColor background, Nullable<TablerColor> textColor = null) #
Returns: InlineText

Convenience for a soft (light) badge using RGBColor background.

Parameters

text System.String requiredposition: 0
background HtmlForgeX.RGBColor requiredposition: 1
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 2
SoftBadgeWithDot 2 overloads
public InlineText SoftBadgeWithDot(String text, RGBColor dotColor, Nullable<TablerColor> badgeColor = null) #
Returns: InlineText
EditorBrowsable(2) Obsolete("Use Badge(..., b => { b.Style = TablerBadgeStyle.Soft; b.WithDot(...); }) instead.", false)

Soft badge with a small colored dot before the text (used for mentions or color swatches).

Parameters

text System.String requiredposition: 0
dotColor HtmlForgeX.TablerColor requiredposition: 1
badgeColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 2
SoftBadgeWithDot(System.String text, HtmlForgeX.RGBColor dotColor, System.Nullable{HtmlForgeX.TablerColor} badgeColor) #

Soft badge with a colored RGB dot before the text.

Parameters

text System.String required
dotColor HtmlForgeX.RGBColor required
badgeColor System.Nullable{HtmlForgeX.TablerColor} required
public InlineText Space(Int32 count = 1) #
Returns: InlineText

Adds one or more spaces.

Parameters

count System.Int32 = 1 optionalposition: 0
Strike 2 overloads
public InlineText Strike(String text, RGBColor color) #
Returns: InlineText

Adds a struck-through run, optional Tabler color.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
Strike(System.String text, HtmlForgeX.RGBColor color) #

Adds a struck-through run with an RGB color.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
public InlineText Strong(String text, Nullable<TablerColor> color = null) #
Returns: InlineText

Adds a strong (bold) run, optional Tabler color.

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 1
public InlineText Subscript(String text) #
Returns: InlineText

Subscript run (<sub>).

Parameters

text System.String requiredposition: 0
public InlineText Superscript(String text) #
Returns: InlineText

Superscript run (<sup>).

Parameters

text System.String requiredposition: 0
Text(System.String text, HtmlForgeX.RGBColor color, HtmlForgeX.RGBColor underlineRgb, HtmlForgeX.LineStyle underlineStyle, HtmlForgeX.RGBColor backgroundRgb, System.Nullable{HtmlForgeX.FontWeight} weight, System.Boolean italic, System.Boolean strike, System.String href, System.Nullable{HtmlForgeX.CodeRunStyle} codeStyle) #

RGBColor overload of the unified Text(...) entry point.

Parameters

text System.String required
color HtmlForgeX.RGBColor required
underlineRgb HtmlForgeX.RGBColor required
underlineStyle HtmlForgeX.LineStyle required
backgroundRgb HtmlForgeX.RGBColor required
weight System.Nullable{HtmlForgeX.FontWeight} required
italic System.Boolean required
strike System.Boolean required
href System.String required
codeStyle System.Nullable{HtmlForgeX.CodeRunStyle} required
public override String ToString() #
Returns: String

Returns the rendered HTML for the composed inline text runs.

Underline 4 overloads
public InlineText Underline(String text, RGBColor color) #
Returns: InlineText

Adds an underlined text run (simple shorthand).

Parameters

text System.String requiredposition: 0
color System.Nullable{HtmlForgeX.TablerColor} = null requiredposition: 1
Underline(System.String text, HtmlForgeX.RGBColor color) #

RGBColor overload of Boolean).

Parameters

text System.String required
color HtmlForgeX.RGBColor required
public InlineText Underline(String text, RGBColor underlineColor, LineStyle style = Solid, RGBColor textRgbColor = null, RGBColor softBackgroundRgb = null, Boolean bold = false) #
Returns: InlineText

Underline with full control. Emits a span, applies text-decoration, and optional soft background tint.

Parameters

text System.String requiredposition: 0
underlineColor System.Nullable{HtmlForgeX.TablerColor} requiredposition: 1
style HtmlForgeX.LineStyle = Solid optionalposition: 2
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 3
softBackground System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 4
bold System.Boolean = false optionalposition: 5
Underline(System.String text, HtmlForgeX.RGBColor underlineColor, HtmlForgeX.LineStyle style, HtmlForgeX.RGBColor textRgbColor, HtmlForgeX.RGBColor softBackgroundRgb, System.Boolean bold) #

RGBColor overload of Boolean).

Parameters

text System.String required
underlineColor HtmlForgeX.RGBColor required
style HtmlForgeX.LineStyle required
textRgbColor HtmlForgeX.RGBColor required
softBackgroundRgb HtmlForgeX.RGBColor required
bold System.Boolean required
public InlineText UnderlineColored(String text, RGBColor underlineColor, Nullable<TablerColor> textColor = null, RGBColor textRgbColor = null) #
Returns: InlineText
EditorBrowsable(2) Obsolete("Use Underline(...) instead.", false)

Back-compat alias for underlined text using an RGB underline color. Prefer Boolean).

Parameters

text System.String requiredposition: 0
underlineColor HtmlForgeX.RGBColor requiredposition: 1
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 2
textRgbColor HtmlForgeX.RGBColor = null optionalposition: 3
UnderlineOnSoft 2 overloads
public InlineText UnderlineOnSoft(String text, RGBColor underlineColor, RGBColor background = null, Boolean bold = false) #
Returns: InlineText

Underlined text with a soft tinted background (similar to Tabler's -lt tokens).

Parameters

text System.String requiredposition: 0
color HtmlForgeX.TablerColor requiredposition: 1
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 2
bold System.Boolean = false optionalposition: 3
UnderlineOnSoft(System.String text, HtmlForgeX.RGBColor underlineColor, HtmlForgeX.RGBColor background, System.Boolean bold) #

Underlined text with custom RGB background (semi-transparent) to mimic soft tint.

Parameters

text System.String required
underlineColor HtmlForgeX.RGBColor required
background HtmlForgeX.RGBColor required
bold System.Boolean required