HtmlForgeX

API Reference

Class

EmailHorizontalRule

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements
ILayoutAware IVisualElement<EmailHorizontalRule> IRoundable<EmailHorizontalRule> IRoundable

Represents a horizontal rule element (<hr>) for email layouts with email-safe styling. Provides a horizontal divider line with customizable color, width, and styling.

Inheritance

Constructors

public EmailHorizontalRule() #

Initializes a new instance of the EmailHorizontalRule class.

Methods

public override Void EvaluateLayout(LayoutContext context) #
Returns: Void

Applies default border radius for the horizontal rule.

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
Layout evaluation context.
public override String ToString() #
Returns: String

Renders the horizontal rule as HTML. Uses a table-based approach for better email client compatibility.

WithBackground 2 overloads
public virtual EmailHorizontalRule WithBackground(RGBColor color) #
Returns: EmailHorizontalRule

Sets the background color.

Parameters

color System.String requiredposition: 0
WithBackground(HtmlForgeX.Email.RGBColor color) #

Sets the background color using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
WithBorder 2 overloads
public virtual EmailHorizontalRule WithBorder(BorderWidth width, String customValue = null) #
Returns: EmailHorizontalRule

Sets the border width using a predefined size.

Parameters

width HtmlForgeX.Email.BorderWidth requiredposition: 0
customValue System.String = null optionalposition: 1
public virtual EmailHorizontalRule WithBorder(Boolean enabled) #
Returns: EmailHorizontalRule

Enables or disables the horizontal rule border.

Parameters

enabled System.Boolean requiredposition: 0
WithBorderColor 2 overloads
public virtual EmailHorizontalRule WithBorderColor(RGBColor color) #
Returns: EmailHorizontalRule

Sets the border color.

Parameters

color System.String requiredposition: 0
WithBorderColor(HtmlForgeX.Email.RGBColor color) #

Sets the border color using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
public virtual EmailHorizontalRule WithBorderRadius(String radius) #
Returns: EmailHorizontalRule

Sets the border radius.

Parameters

radius System.String requiredposition: 0
WithColor 2 overloads
public EmailHorizontalRule WithColor(RGBColor color) #
Returns: EmailHorizontalRule

Sets the color of the horizontal rule (same as background).

Parameters

color System.String requiredposition: 0
WithColor(HtmlForgeX.Email.RGBColor color) #

Sets the color of the horizontal rule using RGBColor.

Parameters

color HtmlForgeX.Email.RGBColor required
public EmailHorizontalRule WithHeight(String height) #
Returns: EmailHorizontalRule

Sets the height of the horizontal rule.

Parameters

height System.String requiredposition: 0
WithRounded 2 overloads
public virtual EmailHorizontalRule WithRounded(Radius radius, String customValue = null) #
Returns: EmailHorizontalRule

Sets the border radius using a predefined size.

Parameters

radius HtmlForgeX.Email.Radius requiredposition: 0
customValue System.String = null optionalposition: 1
public virtual EmailHorizontalRule WithRounded() #
Returns: EmailHorizontalRule

Applies the default border radius (6px) for rounded corners.

public virtual EmailHorizontalRule WithRoundingMode(RoundingMode mode) #
Returns: EmailHorizontalRule

Sets the rounding mode for this horizontal rule.

Parameters

mode HtmlForgeX.Email.RoundingMode requiredposition: 0
Rounding mode.

Returns

The rule instance.

public EmailHorizontalRule WithWidth(String width) #
Returns: EmailHorizontalRule

Sets the width of the horizontal rule.

Parameters

width System.String requiredposition: 0

Properties

public virtual String BackgroundColor { get; set; } #

Gets or sets the background color of the rule.

public virtual String BorderRadius { get; set; } #

Gets or sets the border radius (not typically used for HR).

public virtual RoundingMode RoundingMode { get; set; } #

Controls how rounding is applied when no explicit radius is set.

public virtual String BorderColor { get; set; } #

Gets or sets the border color.

public virtual String BorderWidth { get; set; } #

Gets or sets the border width.

public String Height { get; set; } #

Gets or sets the height of the horizontal rule.

public String Width { get; set; } #

Gets or sets the width of the horizontal rule.