HtmlForgeX

API Reference

Class

EmailOtpCode

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

Email-safe one-time passcode (OTP) / verification code block. Renders the code as a row of cells using table markup for broad client support.

Inheritance

Constructors

Methods

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

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
public override String ToString() #
Returns: String
public EmailOtpCode WithAlignment(Alignment alignment) #
Returns: EmailOtpCode

Sets alignment.

Parameters

alignment HtmlForgeX.Email.Alignment requiredposition: 0
public EmailOtpCode WithBackground(String color) #
Returns: EmailOtpCode

Sets the cell background color.

Parameters

color System.String requiredposition: 0
public EmailOtpCode WithBorderColor(String color) #
Returns: EmailOtpCode

Sets the border color.

Parameters

color System.String requiredposition: 0
public EmailOtpCode WithBorderRadius(String radius) #
Returns: EmailOtpCode

Sets the border radius explicitly.

Parameters

radius System.String requiredposition: 0
public EmailOtpCode WithCellCount(Int32 count) #
Returns: EmailOtpCode

Sets cell count.

Parameters

count System.Int32 requiredposition: 0
public EmailOtpCode WithCellGap(Int32 pixels) #
Returns: EmailOtpCode

Sets cell gap (px).

Parameters

pixels System.Int32 requiredposition: 0
public EmailOtpCode WithCellSize(String size) #
Returns: EmailOtpCode

Sets cell size.

Parameters

size System.String requiredposition: 0
public EmailOtpCode WithCode(String code) #
Returns: EmailOtpCode

Sets the code.

Parameters

code System.String requiredposition: 0
public EmailOtpCode WithGrouping(Int32 groupSize, Int32 groupGapPx = 14) #
Returns: EmailOtpCode

Sets grouping (e.g. 3 for 123 456).

Parameters

groupSize System.Int32 requiredposition: 0
groupGapPx System.Int32 = 14 optionalposition: 1
public EmailOtpCode WithRounded(Radius radius = Medium, String customValue = null) #
Returns: EmailOtpCode

Sets the border radius using a predefined size.

Parameters

radius HtmlForgeX.Email.Radius = Medium optionalposition: 0
customValue System.String = null optionalposition: 1
public virtual EmailOtpCode WithRoundingMode(RoundingMode mode) #
Returns: EmailOtpCode

Sets rounding mode.

Parameters

mode HtmlForgeX.Email.RoundingMode requiredposition: 0
public EmailOtpCode WithTextColor(String color) #
Returns: EmailOtpCode

Sets the text color.

Parameters

color System.String requiredposition: 0

Properties

public String Code { get; set; } #

The code to display (spaces and hyphens are ignored).

public Int32 CellCount { get; set; } #

Number of cells to render (e.g. 6).

public String CellSize { get; set; } #

Size of each cell (e.g. "44px").

public Int32 CellGapPx { get; set; } #

Gap between cells in pixels.

public Int32 GroupSize { get; set; } #

Optional grouping size (e.g. 3 to visually separate 123 456).

public Int32 GroupGapPx { get; set; } #

Gap between groups in pixels.

public String BackgroundColor { get; set; } #

Cell background color (light mode default).

public String BorderColor { get; set; } #

Cell border color (light mode default).

public String BorderWidth { get; set; } #

Border width.

public String BorderRadius { get; set; } #

Border radius.

public virtual RoundingMode RoundingMode { get; set; } #

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

public String TextColor { get; set; } #

Text color (light mode default).

public String FontFamily { get; set; } #

Font family for the code.

public String FontSize { get; set; } #

Font size for the code.

public String FontWeight { get; set; } #

Font weight for the code.

public String Alignment { get; set; } #

Alignment for the block.