Table of Contents

Class MudAvatar

Namespace
MudBlazor
Assembly
MudBlazor.dll

Represents a component which displays circular user profile pictures, icons or text.

public class MudAvatar : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable
Inheritance
MudAvatar
Implements
Inherited Members
Extension Methods

Constructors

MudAvatar()

public MudAvatar()

Properties

AvatarGroup

[CascadingParameter]
protected MudAvatarGroup? AvatarGroup { get; set; }

Property Value

MudAvatarGroup

ChildContent

The content within the avatar.

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Remarks

This property allows for custom content to displayed inside of the avatar, but it is not required.

Classname

protected string Classname { get; }

Property Value

string

Color

The color of the avatar.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Remarks

Defaults to Default. Theme colors are supported.

Elevation

The size of the drop shadow.

[Parameter]
[Category("Appearance")]
public int Elevation { get; set; }

Property Value

int

Remarks

Defaults to 0. A higher number creates a heavier drop shadow. Use a value of 0 for no shadow.

Rounded

Uses rounded corners instead of a circle.

[Parameter]
[Category("Appearance")]
public bool Rounded { get; set; }

Property Value

bool

Remarks

Defaults to false. When true, the border-radius style is set to the theme's default value.

Size

The size of the avatar.

[Parameter]
[Category("Appearance")]
public Size Size { get; set; }

Property Value

Size

Remarks

Defaults to Medium.

Square

Disables rounded corners.

[Parameter]
[Category("Appearance")]
public bool Square { get; set; }

Property Value

bool

Remarks

Defaults to false. Can be overridden by Rounded

Stylesname

protected string Stylesname { get; }

Property Value

string

Variant

The display variant to use.

[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }

Property Value

Variant

Remarks

Defaults to Filled. The variant changes the appearance of the avatar, such as Text, Outlined, or Filled.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

Releases resources used by this component.

public void Dispose()

OnInitialized()

protected override void OnInitialized()

See Also