current theme: placeholder

component :: Avatar

The .avatar component is a visual representation of a user. It shows the user’s initials or an image thumbnail. Its default size is 56px. (See the HTML section below for all options.)

File NameclassSource
component.avatar.css.avatarGithub

HTML

Available modifiers

Available modifiersDescription
.avatarDefault - 56px
.avatar + .avatar-smSmall - 24px
.avatar + .avatar-mdMedium - 36px
.avatar + .avatar-lgLarge - 80px
.avatar + .avatar-xlExtra large - 128px
.avatar + .avatar-onlineUser is online - green dot
.avatar + .avatar-offlineUser is offline - grey dot

Custom properties

The following custom properties are available in the default theme:

PropertyColor
--avatar-colorText color (when no image).
--avatar-background-colorBackground color (when no image).
--avatar-border-colorBorder color.
--avatar-border-widthBorder width.
--avatar-radiusRadius. (0 = square).
--avatar-status-dot-color-offlineStatus dot color: offline.
--avatar-status-dot-color-onlineStatus dot color: online.

Astro component

PropTypeDefaultDescription
sizestringundefinedsm, md, lg, xl (px values)
imageSrcstringundefinedOptional image.
onlinebooleanfalseUser is online - green dot
offlinebooleanfalseUser is offline - grey dot
extraClassstringundefinedAdditional CSS, useful for helper classes.

Available styles

Examples

HTML examples