HtmlForgeX

API Reference

Class

EmailAvatar

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

Small avatar component for email layouts. Renders either an image or a fallback initials "pill" using email-safe markup.

Inheritance

Constructors

Methods

public override String ToString() #
Returns: String
public EmailAvatar WithAlignment(Alignment alignment) #
Returns: EmailAvatar

Sets alignment.

Parameters

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

Sets background color for initials fallback.

Parameters

color System.String requiredposition: 0
public EmailAvatar WithBorder(BorderWidth width, String customValue = null) #
Returns: EmailAvatar

Sets border width using a predefined size.

Parameters

width HtmlForgeX.Email.BorderWidth requiredposition: 0
customValue System.String = null optionalposition: 1
public EmailAvatar WithBorderColor(String color) #
Returns: EmailAvatar

Sets border color.

Parameters

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

Sets border radius explicitly.

Parameters

radius System.String requiredposition: 0
public EmailAvatar WithInitials(String initials) #
Returns: EmailAvatar

Sets fallback initials.

Parameters

initials System.String requiredposition: 0
public EmailAvatar WithRounded(Radius radius = Medium, String customValue = null) #
Returns: EmailAvatar

Sets border radius using a predefined size.

Parameters

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

Sets the rounding mode.

Parameters

mode HtmlForgeX.Email.RoundingMode requiredposition: 0
public EmailAvatar WithShape(EmailAvatarShape shape) #
Returns: EmailAvatar

Sets the avatar shape.

Parameters

shape HtmlForgeX.Email.EmailAvatarShape requiredposition: 0
public EmailAvatar WithSize(String size) #
Returns: EmailAvatar

Sets the avatar size.

Parameters

size System.String requiredposition: 0
public EmailAvatar WithSource(String source, String altText = null) #
Returns: EmailAvatar

Sets the image source.

Parameters

source System.String requiredposition: 0
altText System.String = null optionalposition: 1
public EmailAvatar WithTextColor(String color) #
Returns: EmailAvatar

Sets text color for initials fallback.

Parameters

color System.String requiredposition: 0

Properties

public String Source { get; set; } #

Image source URL/path (optional).

public String AlternativeText { get; set; } #

Alternative text for accessibility.

public String Initials { get; set; } #

Fallback initials rendered when Source is empty.

public String Size { get; set; } #

Avatar size (e.g. "40px").

public EmailAvatarShape Shape { get; set; } #

Avatar shape preset.

public String BackgroundColor { get; set; } #

Background color for initials fallback.

public String TextColor { get; set; } #

Text color for initials fallback.

public String BorderColor { get; set; } #

Border color.

public String BorderWidth { get; set; } #

Border width (e.g. "1px").

public String BorderRadius { get; set; } #

Explicit border radius override.

public virtual RoundingMode RoundingMode { get; set; } #

Controls how rounding is applied when BorderRadius is not explicitly set.

public String LinkUrl { get; set; } #

Optional link URL wrapping the avatar.

public Boolean OpenInNewWindow { get; set; } #

Whether to open the link in a new window.

public String Alignment { get; set; } #

Text alignment of the avatar wrapper.