Avatar

Description

A component that represents a user

Avatars are used to represent users, teams, or entities in the system. They can display images, initials, and presence indicators.

The Persona component builds upon Avatar by adding textual information like name, role, and status, making it ideal for profile cards or contact lists.

API reference

enum

AvatarSize

public enum AvatarSize

Predefined size presets used by the Avatar component.

Namespace
Tesserae
enum

AvatarPresence

public enum AvatarPresence
Namespace
Tesserae
class

Avatar

public sealed class Avatar : ComponentBase<Avatar, HTMLElement>
Namespace
Tesserae
Inheritance
ComponentBase<Avatar, HTMLElement> → Avatar

Constructors

NameDescription
AvatarInitializes a new instance of this class.
Constructor
Avatar
public Avatar(string image = null, string initials = null)

Initializes a new instance of this class.

Properties

NameDescription
ImageUrlGets or sets the image url.
InitialsGets or sets the initials.
SizeValueGets or sets the size value.
PresenceStateGets or sets the presence state.
Property
Avatar.ImageUrl
public string ImageUrl { get ; set ; }

Gets or sets the image url.

Property
Avatar.Initials
public string Initials { get ; set ; }

Gets or sets the initials.

Property
Avatar.SizeValue
public AvatarSize SizeValue { get ; set ; }

Gets or sets the size value.

Property
Avatar.PresenceState
public AvatarPresence PresenceState { get ; set ; }

Gets or sets the presence state.

Methods

NameDescription
SetImageSets the image of the component.
SetInitialsSets the initials of the component.
SizeGets or sets the size of the component.
PresenceConfigures the component to presence.
BackgroundGets or sets the CSS background of the component.
ForegroundGets or sets the CSS color (foreground) of the component.
RenderRenders the component's root HTML element.
Method
Avatar.SetImage
public Avatar SetImage(string url)

Sets the image of the component.

Method
Avatar.SetInitials
public Avatar SetInitials(string initials)

Sets the initials of the component.

Method
Avatar.Size
public Avatar Size(AvatarSize size)

Gets or sets the size of the component.

Method
Avatar.Presence
public Avatar Presence(AvatarPresence presence)

Configures the component to presence.

Method
Avatar.Background
public Avatar Background(string color)

Gets or sets the CSS background of the component.

Method
Avatar.Foreground
public Avatar Foreground(string color)

Gets or sets the CSS color (foreground) of the component.

Method
Avatar.Render
public override HTMLElement Render()

Renders the component's root HTML element.

class

Persona

public sealed class Persona : ComponentBase<Persona, HTMLElement>
Namespace
Tesserae
Inheritance
ComponentBase<Persona, HTMLElement> → Persona

Constructors

NameDescription
PersonaInitializes a new instance of this class.
Constructor
Persona
public Persona(string name = null, string secondaryText = null, string tertiaryText = null, Avatar avatar = null)

Initializes a new instance of this class.

Methods

NameDescription
SetAvatarSets the avatar of the component.
SetNameSets the name of the component.
SetSecondaryTextSets the secondary text of the component.
SetTertiaryTextSets the tertiary text of the component.
CompactRenders the component in a compact form.
RenderRenders the component's root HTML element.
Method
Persona.SetAvatar
public Persona SetAvatar(Avatar avatar)

Sets the avatar of the component.

Method
Persona.SetName
public Persona SetName(string name)

Sets the name of the component.

Method
Persona.SetSecondaryText
public Persona SetSecondaryText(string text)

Sets the secondary text of the component.

Method
Persona.SetTertiaryText
public Persona SetTertiaryText(string text)

Sets the tertiary text of the component.

Method
Persona.Compact
public Persona Compact(bool value = true)

Renders the component in a compact form.

Method
Persona.Render
public override HTMLElement Render()

Renders the component's root HTML element.

Samples

Avatar Sizes and Presence

Avatars support various sizes from XSmall to XLarge and optional presence states.

Initials Fallback

When no image is provided, initials are displayed with a generated background color derived from a deterministic hash of the initials.

Persona Component

Personas combine an avatar with descriptive text.

See also

© 2026 Curiosity. All rights reserved.