Avatar
Kendo UI Avatar component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class Avatar : WidgetBase, IWidget, IHtmlAttributesContainer, IScriptableComponent
Inheritance: objectWidgetBaseAvatar
Implements:
Inherited Members
Constructors
Initializes a new instance of the Avatar class.
public Avatar(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
The view context
initializerIJavaScriptInitializerThe JavaScriptInitializer
urlGeneratorIUrlGeneratorThe URL generator.
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.
public string Alt { get; set; }
Specifies whether the avatar should render border around its container element. Default is false.
public bool? Border { get; set; }
Adds additional custom classes to the Avatar container element.
public string ClassName { get; set; }
Specifies the appearance fill style of the Avatar. The available values are "outline", "solid" (default), and null.
public AvatarFillMode? FillMode { 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.
public string Icon { get; set; }
Specifies an image URL or dataURL that would be used to populate the src attribute of the avatar <img> element.
public string Image { get; set; }
Could be one of the predefined shapes available for the widget container: "circle" (default), "small", "medium", "large", or null.
public Rounded? Rounded { get; set; }
The Avatar allows you to set predefined sizes. The available size values are "small", "medium" (default), "large", or null.
public ComponentSize? Size { get; set; }
Sets additional CSS styles to the Avatar container element.
public IDictionary<string, object> Style { get; set; }
Will be used to populated Avatar content when its type is set to text
public string Text { get; set; }
The Avatar allows you to specify predefined theme colors for background of its container. The available themeColor values are: - base - Applies base theme color. - primary (Default) - Applies coloring based on primary theme color. - secondary - Applies coloring based on secondary theme color. - tertiary - Applies coloring based on tertiary theme color. - null - Does not apply theme color class.
public AvatarThemeColor? ThemeColor { get; set; }
Could be one of the three predefined types for the widget: icon, image, or text (default).
public AvatarType? Type { get; set; }
Methods
public override IDictionary<string, object> Serialize()
Overrides:
Writes the HTML.
protected override void WriteHtml(HtmlTextWriter writer)
The HtmlTextWriter.
Overrides:
Writes the initialization script.
public override void WriteInitializationScript(TextWriter writer)
The TextWriter.
Overrides: