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
public enum AvatarSizePredefined size presets used by the component.
public enum AvatarPresencepublic sealed class Avatar : ComponentBase<Avatar, HTMLElement>Constructors
Properties
Methods
public Avatar SetInitials(string initials)Sets the initials of the component.
public Avatar Presence(AvatarPresence presence)Configures the component to presence.
public Avatar Background(string color)Gets or sets the CSS background of the component.
public Avatar Foreground(string color)Gets or sets the CSS color (foreground) of the component.
public sealed class Persona : ComponentBase<Persona, HTMLElement>Constructors
Methods
public Persona SetSecondaryText(string text)Sets the secondary text of the component.
public Persona SetTertiaryText(string text)Sets the tertiary text of the component.
public Persona Compact(bool value = true)Renders the component in a compact form.
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.