RadzenGravatar Class

A Gravatar avatar component that displays a user's profile image from Gravatar.com based on their email address. RadzenGravatar automatically fetches and displays the globally recognized avatar associated with an email. Gravatar (Globally Recognized Avatar) is a service that associates profile images with email addresses. Fetches avatar using MD5 hash of email address, requires no storage or management of avatar images, shows default retro-style avatar if email has no Gravatar, features configurable pixel dimensions, and uses secure.gravatar.com to retrieve images. Generates a Gravatar URL from the email and displays it as an image. If the email doesn't have a Gravatar account, a retro-style default avatar is shown. Commonly used in user profiles, comment sections, or anywhere user identity is displayed.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenGravatar

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenGravatar : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

Basic Gravatar:

<RadzenGravatar Email="user@example.com" />

Large Gravatar with custom alternate text:

<RadzenGravatar Email=@currentUser.Email Size="80" AlternateText=@currentUser.Name />

Gravatar in profile header:

<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" AlignItems="AlignItems.Center">
    <RadzenGravatar Email=@user.Email Size="64" />
    <RadzenText TextStyle="TextStyle.H5">@user.Name</RadzenText>
</RadzenStack>

Constructors

RadzenGravatarlink

A Gravatar avatar component that displays a user's profile image from Gravatar.com based on their email address. RadzenGravatar automatically fetches and displays the globally recognized avatar associated with an email. Gravatar (Globally Recognized Avatar) is a service that associates profile images with email addresses. Fetches avatar using MD5 hash of email address, requires no storage or management of avatar images, shows default retro-style avatar if email has no Gravatar, features configurable pixel dimensions, and uses secure.gravatar.com to retrieve images. Generates a Gravatar URL from the email and displays it as an image. If the email doesn't have a Gravatar account, a retro-style default avatar is shown. Commonly used in user profiles, comment sections, or anywhere user identity is displayed.

Declaration
public RadzenGravatar()

Properties

AlternateTextlink

Gets or sets the alternate text describing the avatar for accessibility. This text is read by screen readers and displayed if the image fails to load.

Declaration
public string AlternateText { get; set; }
Property Value
Type Description
stringGets or sets the alternate text describing the avatar for accessibility. This text is read by screen readers and displayed if the image fails to load.

Emaillink

Gets or sets the email address used to fetch the Gravatar image. The email is hashed (MD5) and used to query Gravatar.com for the associated profile image.

Declaration
public string Email { get; set; }
Property Value
Type Description
stringGets or sets the email address used to fetch the Gravatar image. The email is hashed (MD5) and used to query Gravatar.com for the associated profile image.

Sizelink

Gets or sets the size of the avatar image in pixels (both width and height). Gravatar provides square images at various sizes.

Declaration
public int Size { get; set; }
Property Value
Type Description
intGets or sets the size of the avatar image in pixels (both width and height). Gravatar provides square images at various sizes.

Urllink

Gets gravatar URL.

Declaration
protected string Url { get; }
Property Value
Type Description
stringGets gravatar URL.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙