AvatarTagHelper
Kendo UI Avatar TagHelper AvatarTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-avatar")]
public class AvatarTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent
Inheritance: objectTagHelperTagHelperBaseAvatarTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-avatar name="avatar" type="AvatarType.Image" image="https://example.com/avatar.jpg" alt="User avatar"></kendo-avatar>
Child Tags
Constructors
Initializes a new instance of the AvatarTagHelper class.
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; }
Sets a value controlling how the color is applied.
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.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.
[HtmlAttributeName("icon")]
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; }
The Avatar allows you to set predefined sizes. When undefined (the default), the theme controls the default size. The available size values are "small", "medium", "large".The "none" value is deprecated. Use custom CSS instead.
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; }
Sets the theme color
public AvatarThemeColor? ThemeColor { get; set; }
Sets the type of the avatar.
public AvatarType? Type { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: