New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Avatar

Class

Kendo UI Avatar component

Definition

Constructors

Initializes a new instance of the Avatar class.

C#
public Avatar(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

A text description of the Avatar image. When type="image" is configured this value will be used to populate the alt attribute of the <img> element.

C#
public string Alt { get; set; }

Specifies whether the avatar should render border around its container element. Default is false.

C#
public bool? Border { get; set; }

Adds additional custom classes to the Avatar container element.

C#
public string ClassName { get; set; }

Sets a value controlling how the color is applied.

C#
public AvatarFillMode? FillMode { get; set; }
C#
public string Icon { get; set; }

Specifies an icon name to be used if the avatar type is set to icon. For a list of available icon names, please refer to the Web Font Icons article.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

C#
public AvatarIconSettings IconSettings { get; }

Specifies an image URL or dataURL that would be used to populate the src attribute of the avatar <img> element.

C#
public string Image { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }
C#
public ComponentSize? Size { get; set; }

Sets additional CSS styles to the Avatar container element.

C#
public IDictionary<string, object> Style { get; set; }

Will be used to populated Avatar content when its type is set to text

C#
public string Text { get; set; }

Sets the theme color

C#
public AvatarThemeColor? ThemeColor { get; set; }

Sets the type of the avatar.

C#
public AvatarType? Type { get; set; }

Methods

Serializes the component settings to a dictionary.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteHtml(TextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)